-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gh-124: use cosmology.api
over the cosmology
package
#397
base: main
Are you sure you want to change the base?
Changes from 5 commits
2455fe0
e600795
0621f3d
cf52194
88428cb
2b8912f
96b7030
c4221b3
187063a
16087c8
0a83b2e
663f80a
c8e5ddd
55854dc
d88aa44
44011dc
ff590a9
c7745ef
83f6c12
d5e47ac
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ | |
from glass.shells import RadialWindow | ||
|
||
if typing.TYPE_CHECKING: | ||
from cosmology import Cosmology | ||
from cosmology.api import StandardCosmology | ||
|
||
|
||
@pytest.fixture | ||
|
@@ -31,14 +31,14 @@ def shells() -> list[RadialWindow]: | |
|
||
|
||
@pytest.fixture | ||
def cosmo() -> Cosmology: | ||
def cosmo() -> StandardCosmology: | ||
class MockCosmology: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've changed the mock to match the names from |
||
@property | ||
def omega_m(self) -> float: | ||
def Omega_m0(self) -> float: # noqa: N802 | ||
return 0.3 | ||
|
||
def ef(self, z: npt.NDArray[np.float64]) -> npt.NDArray[np.float64]: | ||
return (self.omega_m * (1 + z) ** 3 + 1 - self.omega_m) ** 0.5 | ||
def H_over_H0(self, z: npt.NDArray[np.float64]) -> npt.NDArray[np.float64]: # noqa: N802 | ||
return (self.Omega_m0 * (1 + z) ** 3 + 1 - self.Omega_m0) ** 0.5 | ||
|
||
def xm( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is no equivalently named function in cosmology.api.Standard.Cosmology.transverse_comoving_distance(z) / (cosmology.api.CosmologyConstantsNamespace.c / cosmology.api.Standard.Cosmology.H0) |
||
self, | ||
|
@@ -97,7 +97,7 @@ def test_deflect_many(rng: np.random.Generator) -> None: | |
|
||
def test_multi_plane_matrix( | ||
shells: list[RadialWindow], | ||
cosmo: Cosmology, | ||
cosmo: StandardCosmology, | ||
rng: np.random.Generator, | ||
) -> None: | ||
mat = multi_plane_matrix(shells, cosmo) | ||
|
@@ -119,7 +119,7 @@ def test_multi_plane_matrix( | |
|
||
def test_multi_plane_weights( | ||
shells: list[RadialWindow], | ||
cosmo: Cosmology, | ||
cosmo: StandardCosmology, | ||
rng: np.random.Generator, | ||
) -> None: | ||
w_in = np.eye(len(shells)) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cosmology
is still used in the notebooks currently