Skip to content

Commit

Permalink
Rename files and update healpy version
Browse files Browse the repository at this point in the history
  • Loading branch information
MetinSa committed Jul 2, 2024
1 parent 5275387 commit 4d492de
Show file tree
Hide file tree
Showing 13 changed files with 351 additions and 805 deletions.
1,038 changes: 301 additions & 737 deletions poetry.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ mkdocstrings-python = "^1.7.3"
ruff = "^0.3.7"
markdown = "^3.6.0"
hypothesis = "^6.99.11"
healpy = "^1.16.6"
healpy = "^1.17.1"
astropy-healpix = "^1.0.3"

[build-system]
Expand Down
64 changes: 32 additions & 32 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
astropy-iers-data==0.2024.5.6.0.29.28 ; python_version >= "3.9" \
--hash=sha256:7f02a20d4bc72c22533123734cc48d694cdd32adc471c5d6659218d788b611da \
--hash=sha256:ad992722705af68b4fe3b79983c05c4bbed01b3ed31466fe6f574ddfb986b620
astropy-iers-data==0.2024.7.1.0.34.3 ; python_version >= "3.9" \
--hash=sha256:0e3b47ae2ed44a03c3bea40a2b73bfce1858cf4059b4612c677a5e4a90f86003 \
--hash=sha256:195053a2b198f964ad89440b419fa4e506d9db6a8e1cc18a387bc9c3b480a09e
astropy==6.0.1 ; python_version >= "3.9" \
--hash=sha256:034dff5994428fb89813f40a18600dd8804128c52edf3d1baa8936eca3738de4 \
--hash=sha256:129ed1fb1d23e6fbf8b8e697c2e7340d99bc6271b8c59f9572f3f47063a42e6a \
Expand Down Expand Up @@ -71,9 +71,9 @@ numpy==1.26.4 ; python_version >= "3.9" \
--hash=sha256:edd8b5fe47dab091176d21bb6de568acdd906d1887a4584a15a9a96a1dca06ef \
--hash=sha256:f870204a840a60da0b12273ef34f7051e98c3b5961b61b0c2c1be6dfd64fbcd3 \
--hash=sha256:ffa75af20b44f8dba823498024771d5ac50620e6915abac414251bd971b4529f
packaging==24.0 ; python_version >= "3.9" \
--hash=sha256:2ddfb553fdf02fb784c234c7ba6ccc288296ceabec964ad2eae3777778130bc5 \
--hash=sha256:eb82c5e3e56209074766e6885bb04b8c38a0c015d0a30036ebe7ece34c9989e9
packaging==24.1 ; python_version >= "3.9" \
--hash=sha256:026ed72c8ed3fcce5bf8950572258698927fd1dbda10a5e981cdf0ac37f4f002 \
--hash=sha256:5b8f2217dbdbd2f7f384c41c628544e6d52f2d0f53c6d0c3ea61aa5d1d7ff124
pyerfa==2.0.1.4 ; python_version >= "3.9" \
--hash=sha256:39cf838c9a21e40d4e3183bead65b3ce6af763c4a727f87d84909c9be7d3a33c \
--hash=sha256:46d3bed0ac666f08d8364b34a00b8c6595358d6c4f4532da8d13fac0e5227baa \
Expand Down Expand Up @@ -137,29 +137,29 @@ pyyaml==6.0.1 ; python_version >= "3.9" \
--hash=sha256:fca0e3a251908a499833aa292323f32437106001d436eca0e6e7833256674585 \
--hash=sha256:fd1592b3fdf65fff2ad0004b5e363300ef59ced41c2e6b3a99d4089fa8c5435d \
--hash=sha256:fd66fc5d0da6d9815ba2cebeb4205f95818ff4b79c3ebe268e75d961704af52f
scipy==1.13.0 ; python_version >= "3.9" \
--hash=sha256:05f1432ba070e90d42d7fd836462c50bf98bd08bed0aa616c359eed8a04e3922 \
--hash=sha256:09c74543c4fbeb67af6ce457f6a6a28e5d3739a87f62412e4a16e46f164f0ae5 \
--hash=sha256:0fbcf8abaf5aa2dc8d6400566c1a727aed338b5fe880cde64907596a89d576fa \
--hash=sha256:109d391d720fcebf2fbe008621952b08e52907cf4c8c7efc7376822151820820 \
--hash=sha256:1d2f7bb14c178f8b13ebae93f67e42b0a6b0fc50eba1cd8021c9b6e08e8fb1cd \
--hash=sha256:1e7626dfd91cdea5714f343ce1176b6c4745155d234f1033584154f60ef1ff42 \
--hash=sha256:22789b56a999265431c417d462e5b7f2b487e831ca7bef5edeb56efe4c93f86e \
--hash=sha256:28e286bf9ac422d6beb559bc61312c348ca9b0f0dae0d7c5afde7f722d6ea13d \
--hash=sha256:33fde20efc380bd23a78a4d26d59fc8704e9b5fd9b08841693eb46716ba13d86 \
--hash=sha256:45c08bec71d3546d606989ba6e7daa6f0992918171e2a6f7fbedfa7361c2de1e \
--hash=sha256:4dca18c3ffee287ddd3bc8f1dabaf45f5305c5afc9f8ab9cbfab855e70b2df5c \
--hash=sha256:5407708195cb38d70fd2d6bb04b1b9dd5c92297d86e9f9daae1576bd9e06f602 \
--hash=sha256:58569af537ea29d3f78e5abd18398459f195546bb3be23d16677fb26616cc11e \
--hash=sha256:5e4a756355522eb60fcd61f8372ac2549073c8788f6114449b37e9e8104f15a5 \
--hash=sha256:6bf9fe63e7a4bf01d3645b13ff2aa6dea023d38993f42aaac81a18b1bda7a82a \
--hash=sha256:8930ae3ea371d6b91c203b1032b9600d69c568e537b7988a3073dfe4d4774f21 \
--hash=sha256:9ff7dad5d24a8045d836671e082a490848e8639cabb3dbdacb29f943a678683d \
--hash=sha256:a2f471de4d01200718b2b8927f7d76b5d9bde18047ea0fa8bd15c5ba3f26a1d6 \
--hash=sha256:ac38c4c92951ac0f729c4c48c9e13eb3675d9986cc0c83943784d7390d540c78 \
--hash=sha256:b2a3ff461ec4756b7e8e42e1c681077349a038f0686132d623fa404c0bee2551 \
--hash=sha256:b5acd8e1dbd8dbe38d0004b1497019b2dbbc3d70691e65d69615f8a7292865d7 \
--hash=sha256:b8434f6f3fa49f631fae84afee424e2483289dfc30a47755b4b4e6b07b2633a4 \
--hash=sha256:ba419578ab343a4e0a77c0ef82f088238a93eef141b2b8017e46149776dfad4d \
--hash=sha256:d0de696f589681c2802f9090fff730c218f7c51ff49bf252b6a97ec4a5d19e8b \
--hash=sha256:dcbb9ea49b0167de4167c40eeee6e167caeef11effb0670b554d10b1e693a8b9
scipy==1.13.1 ; python_version >= "3.9" \
--hash=sha256:017367484ce5498445aade74b1d5ab377acdc65e27095155e448c88497755a5d \
--hash=sha256:095a87a0312b08dfd6a6155cbbd310a8c51800fc931b8c0b84003014b874ed3c \
--hash=sha256:20335853b85e9a49ff7572ab453794298bcf0354d8068c5f6775a0eabf350aca \
--hash=sha256:27e52b09c0d3a1d5b63e1105f24177e544a222b43611aaf5bc44d4a0979e32f9 \
--hash=sha256:2831f0dc9c5ea9edd6e51e6e769b655f08ec6db6e2e10f86ef39bd32eb11da54 \
--hash=sha256:2ac65fb503dad64218c228e2dc2d0a0193f7904747db43014645ae139c8fad16 \
--hash=sha256:392e4ec766654852c25ebad4f64e4e584cf19820b980bc04960bca0b0cd6eaa2 \
--hash=sha256:436bbb42a94a8aeef855d755ce5a465479c721e9d684de76bf61a62e7c2b81d5 \
--hash=sha256:45484bee6d65633752c490404513b9ef02475b4284c4cfab0ef946def50b3f59 \
--hash=sha256:54f430b00f0133e2224c3ba42b805bfd0086fe488835effa33fa291561932326 \
--hash=sha256:5713f62f781eebd8d597eb3f88b8bf9274e79eeabf63afb4a737abc6c84ad37b \
--hash=sha256:5d72782f39716b2b3509cd7c33cdc08c96f2f4d2b06d51e52fb45a19ca0c86a1 \
--hash=sha256:637e98dcf185ba7f8e663e122ebf908c4702420477ae52a04f9908707456ba4d \
--hash=sha256:8335549ebbca860c52bf3d02f80784e91a004b71b059e3eea9678ba994796a24 \
--hash=sha256:949ae67db5fa78a86e8fa644b9a6b07252f449dcf74247108c50e1d20d2b4627 \
--hash=sha256:a014c2b3697bde71724244f63de2476925596c24285c7a637364761f8710891c \
--hash=sha256:a78b4b3345f1b6f68a763c6e25c0c9a23a9fd0f39f5f3d200efe8feda560a5fa \
--hash=sha256:cdd7dacfb95fea358916410ec61bbc20440f7860333aee6d882bb8046264e949 \
--hash=sha256:cfa31f1def5c819b19ecc3a8b52d28ffdcc7ed52bb20c9a7589669dd3c250989 \
--hash=sha256:d533654b7d221a6a97304ab63c41c96473ff04459e404b83275b60aa8f4b7004 \
--hash=sha256:d605e9c23906d1994f55ace80e0125c587f96c020037ea6aa98d01b4bd2e222f \
--hash=sha256:de3ade0e53bc1f21358aa74ff4830235d716211d7d077e340c7349bc3542e884 \
--hash=sha256:e89369d27f9e7b0884ae559a3a956e77c02114cc60a6058b4e5011572eea9299 \
--hash=sha256:eccfa1906eacc02de42d70ef4aecea45415f5be17e72b61bafcfd329bdc52e94 \
--hash=sha256:f26264b282b9da0952a024ae34710c2aff7d27480ee91a2e82b7b7073c24722f
18 changes: 0 additions & 18 deletions tests/test_evaluate.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,24 +168,6 @@ def test_return_comps() -> None:
assert_array_equal(emission_comps.sum(axis=0), emission)


def test_contains_duplicates() -> None:
"""Test that evaluations with and without the test duplicates flag are the same."""
lon = np.random.randint(low=0, high=360, size=10000)
lat = np.random.randint(low=-90, high=90, size=10000)

unique = np.unique(np.vstack([lon, lat]), axis=1)
assert len(lon) > unique.shape[1]
skycoord = SkyCoord(
lon,
lat,
unit=units.deg,
obstime=TEST_TIME,
)
emission = test_model.evaluate(skycoord, contains_duplicates=False)
emission_duplicates = test_model.evaluate(skycoord, contains_duplicates=True)
assert_array_equal(emission, emission_duplicates)


def test_multiprocessing_nproc() -> None:
"""Test that the multiprocessing works with n_proc > 1."""
model = Model(x=20 * units.micron)
Expand Down
2 changes: 1 addition & 1 deletion zodipy/zodiacal_component.py → zodipy/component.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class ZodiacalComponent(abc.ABC):
cos_Omega_rad: float = field(init=False)

def __post_init__(self) -> None:
self.X_0 = np.array([self.x_0, self.y_0, self.z_0]).reshape(3, 1)
self.X_0 = np.expand_dims([self.x_0, self.y_0, self.z_0], axis=-1)
self.sin_i_rad = np.sin(np.radians(self.i))
self.cos_i_rad = np.cos(np.radians(self.i))
self.sin_Omega_rad = np.sin(np.radians(self.Omega))
Expand Down
2 changes: 1 addition & 1 deletion zodipy/comps.py → zodipy/component_params.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import annotations

from zodipy.zodiacal_component import (
from zodipy.component import (
Band,
BroadBand,
Cloud,
Expand Down
4 changes: 2 additions & 2 deletions zodipy/line_of_sight.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

import numpy as np

from zodipy.comps import RRM
from zodipy.zodiacal_component import ComponentLabel
from zodipy.component import ComponentLabel
from zodipy.component_params import RRM

if TYPE_CHECKING:
import numpy.typing as npt
Expand Down
2 changes: 1 addition & 1 deletion zodipy/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@

from zodipy.blackbody import tabulate_blackbody_emission
from zodipy.bodies import get_earthpos_xyz, get_obspos_xyz
from zodipy.component import ComponentLabel
from zodipy.line_of_sight import (
get_line_of_sight_range,
integrate_leggauss,
)
from zodipy.model_registry import model_registry
from zodipy.number_density import populate_number_density_with_model
from zodipy.unpack_model import get_model_to_dicts_callable
from zodipy.zodiacal_component import ComponentLabel

_PLATFORM_METHOD = "fork" if "windows" not in platform.system().lower() else None

Expand Down
14 changes: 7 additions & 7 deletions zodipy/model_registry.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from zodipy import comps, source_params
from zodipy import component_params, source_params
from zodipy.zodiacal_light_model import RRM, Kelsall, model_registry

model_registry.register_model(
name="dirbe",
model=Kelsall(
comps=comps.DIRBE,
comps=component_params.DIRBE,
spectrum=source_params.SPECTRUM_DIRBE,
emissivities=source_params.EMISSIVITY_DIRBE,
albedos=source_params.ALBEDO_DIRBE,
Expand All @@ -20,7 +20,7 @@
model_registry.register_model(
name="planck13",
model=Kelsall(
comps=comps.DIRBE,
comps=component_params.DIRBE,
spectrum=source_params.SPECTRUM_PLANCK,
emissivities=source_params.EMISSIVITY_PLANCK_13,
T_0=source_params.T_0_DIRBE,
Expand All @@ -31,7 +31,7 @@
model_registry.register_model(
name="planck15",
model=Kelsall(
comps=comps.PLANCK,
comps=component_params.PLANCK,
spectrum=source_params.SPECTRUM_PLANCK,
emissivities=source_params.EMISSIVITY_PLANCK_15,
T_0=source_params.T_0_DIRBE,
Expand All @@ -42,7 +42,7 @@
model_registry.register_model(
name="planck18",
model=Kelsall(
comps=comps.PLANCK,
comps=component_params.PLANCK,
spectrum=source_params.SPECTRUM_PLANCK,
emissivities=source_params.EMISSIVITY_PLANCK_18,
T_0=source_params.T_0_DIRBE,
Expand All @@ -53,7 +53,7 @@
model_registry.register_model(
name="odegard",
model=Kelsall(
comps=comps.PLANCK,
comps=component_params.PLANCK,
spectrum=source_params.SPECTRUM_PLANCK,
emissivities=source_params.EMISSIVITY_ODEGARD,
T_0=source_params.T_0_DIRBE,
Expand All @@ -64,7 +64,7 @@
model_registry.register_model(
name="rrm-experimental",
model=RRM(
comps=comps.RRM,
comps=component_params.RRM,
spectrum=source_params.SPECTRUM_IRAS,
calibration=source_params.CALIBRATION_RRM,
T_0=source_params.T_0_RRM,
Expand Down
4 changes: 2 additions & 2 deletions zodipy/number_density.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
import numpy.typing as npt # type: ignore

from zodipy.bodies import get_earthpos_xyz
from zodipy.model_registry import model_registry
from zodipy.zodiacal_component import (
from zodipy.component import (
Band,
BroadBand,
Cloud,
Expand All @@ -25,6 +24,7 @@
RingRRM,
ZodiacalComponent,
)
from zodipy.model_registry import model_registry

if TYPE_CHECKING:
from astropy import time, units
Expand Down
2 changes: 1 addition & 1 deletion zodipy/source_params.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import astropy.units as u

from zodipy.zodiacal_component import ComponentLabel
from zodipy.component import ComponentLabel

T_0_DIRBE = 286
DELTA_DIRBE = 0.46686259861486573
Expand Down
2 changes: 1 addition & 1 deletion zodipy/unpack_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from astropy import units
from scipy import integrate, interpolate

from zodipy.comps import ComponentLabel
from zodipy.component import ComponentLabel
from zodipy.zodiacal_light_model import RRM, Kelsall, ZodiacalLightModel

CompParamDict = dict[ComponentLabel, dict[str, Any]]
Expand Down
2 changes: 1 addition & 1 deletion zodipy/zodiacal_light_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
)

if TYPE_CHECKING:
from zodipy.zodiacal_component import ComponentLabel, ZodiacalComponent
from zodipy.component import ComponentLabel, ZodiacalComponent


@dataclass(repr=False)
Expand Down

0 comments on commit 4d492de

Please sign in to comment.