-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gh-107: add all public functions/classes under glass namespace
- Loading branch information
1 parent
12f3265
commit 080ee4c
Showing
10 changed files
with
102 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
[flake8] | ||
ignore = E226,E501,E741 | ||
per-file-ignores = | ||
glass/__init__.py:F401 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,71 @@ | ||
try: | ||
from ._version import __version__, __version_tuple__ # noqa: F401 | ||
from glass._version import __version__, __version_tuple__ | ||
except ModuleNotFoundError: | ||
pass | ||
|
||
from glass.fields import ( | ||
iternorm, | ||
cls2cov, | ||
multalm, | ||
transform_cls, | ||
gaussian_gls, | ||
lognormal_gls, | ||
generate_gaussian, | ||
generate_lognormal, | ||
getcl, | ||
effective_cls, | ||
) | ||
from glass.galaxies import ( | ||
redshifts, | ||
redshifts_from_nz, | ||
galaxy_shear, | ||
gaussian_phz, | ||
) | ||
from glass.lensing import ( | ||
from_convergence, | ||
shear_from_convergence, | ||
MultiPlaneConvergence, | ||
multi_plane_matrix, | ||
multi_plane_weights, | ||
deflect, | ||
) | ||
from glass.observations import ( | ||
vmap_galactic_ecliptic, | ||
gaussian_nz, | ||
smail_nz, | ||
fixed_zbins, | ||
equal_dens_zbins, | ||
tomo_nz_gausserr, | ||
) | ||
from glass.points import ( | ||
effective_bias, | ||
linear_bias, | ||
loglinear_bias, | ||
positions_from_delta, | ||
uniform_positions, | ||
position_weights, | ||
) | ||
from glass.shapes import ( | ||
triaxial_axis_ratio, | ||
ellipticity_ryden04, | ||
ellipticity_gaussian, | ||
ellipticity_intnorm, | ||
) | ||
from glass.shells import ( | ||
distance_weight, | ||
volume_weight, | ||
density_weight, | ||
tophat_windows, | ||
linear_windows, | ||
cubic_windows, | ||
restrict, | ||
partition, | ||
partition_lstsq, | ||
partition_nnls, | ||
partition_restrict, | ||
redshift_grid, | ||
distance_grid, | ||
combine, | ||
RadialWindow, | ||
) | ||
from glass.user import save_cls, load_cls, write_catalog |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
# author: Nicolas Tessore <[email protected]> | ||
# license: MIT | ||
''' | ||
Random fields (:mod:`glass.fields`) | ||
=================================== | ||
Random fields | ||
============= | ||
.. currentmodule:: glass.fields | ||
.. currentmodule:: glass | ||
The :mod:`glass.fields` module provides functionality for simulating random | ||
fields on the sphere. This is done in the form of HEALPix maps. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
# author: Nicolas Tessore <[email protected]> | ||
# license: MIT | ||
''' | ||
Galaxies (:mod:`glass.galaxies`) | ||
================================ | ||
Galaxies | ||
======== | ||
.. currentmodule:: glass.galaxies | ||
.. currentmodule:: glass | ||
The :mod:`glass.galaxies` module provides functionality for simulating galaxies | ||
as typically observed in a cosmological galaxy survey. | ||
|
@@ -26,8 +26,8 @@ | |
|
||
from numpy.typing import ArrayLike | ||
|
||
from .core.array import broadcast_leading_axes, cumtrapz | ||
from .shells import RadialWindow | ||
from glass.core.array import broadcast_leading_axes, cumtrapz | ||
from glass.shells import RadialWindow | ||
|
||
|
||
def redshifts(n: int | ArrayLike, w: RadialWindow, *, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
# author: Nicolas Tessore <[email protected]> | ||
# license: MIT | ||
''' | ||
Lensing (:mod:`glass.lensing`) | ||
============================== | ||
Lensing | ||
======= | ||
.. currentmodule:: glass.lensing | ||
.. currentmodule:: glass | ||
The :mod:`glass.lensing` module provides functionality for simulating | ||
gravitational lensing by the matter distribution in the universe. | ||
|
@@ -40,7 +40,7 @@ | |
if TYPE_CHECKING: | ||
# to prevent circular dependencies, only import these for type checking | ||
from cosmology import Cosmology | ||
from .shells import RadialWindow | ||
from glass.shells import RadialWindow | ||
|
||
|
||
def from_convergence(kappa: NDArray, lmax: Optional[int] = None, *, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
# author: Nicolas Tessore <[email protected]> | ||
# license: MIT | ||
''' | ||
Observations (:mod:`glass.observations`) | ||
======================================== | ||
Observations | ||
============ | ||
.. currentmodule:: glass.observations | ||
.. currentmodule:: glass | ||
The :mod:`glass.observations` module provides functionality for simulating | ||
observational effects of surveys. | ||
|
@@ -35,7 +35,7 @@ | |
from typing import Optional, Tuple, List | ||
from numpy.typing import ArrayLike | ||
|
||
from .core.array import cumtrapz | ||
from glass.core.array import cumtrapz | ||
|
||
|
||
def vmap_galactic_ecliptic(nside: int, galactic: Tuple[float, float] = (30, 90), | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
# author: Nicolas Tessore <[email protected]> | ||
# license: MIT | ||
''' | ||
Random points (:mod:`glass.points`) | ||
=================================== | ||
Random points | ||
============= | ||
.. currentmodule:: glass.points | ||
.. currentmodule:: glass | ||
The :mod:`glass.points` module provides functionality for simulating point | ||
processes on the sphere and sampling random positions. | ||
|
@@ -34,8 +34,8 @@ | |
import numpy as np | ||
import healpix | ||
|
||
from .core.array import broadcast_first, broadcast_leading_axes, trapz_product | ||
from .core.constants import ARCMIN2_SPHERE | ||
from glass.core.array import broadcast_first, broadcast_leading_axes, trapz_product | ||
from glass.core.constants import ARCMIN2_SPHERE | ||
|
||
|
||
def effective_bias(z, bz, w): | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
# author: Nicolas Tessore <[email protected]> | ||
# license: MIT | ||
''' | ||
Observed shapes (:mod:`glass.shapes`) | ||
===================================== | ||
Observed shapes | ||
=============== | ||
.. currentmodule:: glass.shapes | ||
.. currentmodule:: glass | ||
The :mod:`glass.shapes` module provides functionality for simulating the | ||
observed shapes of objects, such as e.g. galaxies. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
# author: Nicolas Tessore <[email protected]> | ||
# license: MIT | ||
''' | ||
Shells (:mod:`glass.shells`) | ||
============================ | ||
Shells | ||
====== | ||
.. currentmodule:: glass.shells | ||
.. currentmodule:: glass | ||
The :mod:`glass.shells` module provides functions for the definition of | ||
matter shells, i.e. the radial discretisation of the light cone. | ||
|
@@ -49,7 +49,7 @@ | |
from collections import namedtuple | ||
import numpy as np | ||
|
||
from .core.array import ndinterp | ||
from glass.core.array import ndinterp | ||
|
||
# type checking | ||
from typing import (Union, Sequence, List, Tuple, Optional, Callable, | ||
|
@@ -503,7 +503,7 @@ def partition_nnls( | |
""" | ||
|
||
from .core.algorithm import nnls | ||
from glass.core.algorithm import nnls | ||
|
||
# make sure nothing breaks | ||
if sumtol < 1e-4: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
# author: Nicolas Tessore <[email protected]> | ||
# license: MIT | ||
''' | ||
User utilities (:mod:`glass.user`) | ||
================================== | ||
User utilities | ||
============== | ||
.. currentmodule:: glass.user | ||
.. currentmodule:: glass | ||
The :mod:`glass.user` module contains convenience functions for users of the | ||
library. | ||
|