-
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?
Conversation
@@ -49,6 +49,7 @@ docs = [ | |||
] | |||
examples = [ | |||
"camb", | |||
"cosmology", |
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
@@ -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 comment
The reason will be displayed to describe this comment to others. Learn more.
I've changed the mock to match the names from cosmology.api
, hence the noqa
glass/galaxies.py
Outdated
Intrinsic alignments | ||
-------------------- | ||
.. autofunction:: kappa_ia_nla |
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.
I have reverted #21 as I believe it is broken/needs testing. Don't want to waste time porting.
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 comment
The reason will be displayed to describe this comment to others. Learn more.
There is no equivalently named function in cosmology.api
. In practice, this would be
cosmology.api.Standard.Cosmology.transverse_comoving_distance(z) / (cosmology.api.CosmologyConstantsNamespace.c / cosmology.api.Standard.Cosmology.H0)
x2 = self.x3 | ||
self.x3 = self.cosmo.transverse_comoving_distance(self.z3) / hubble_length |
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.
I've split these so the line isn't really long
Closes #124. Use the improved
cosmology.api
package throughout the code.