Skip to content

Commit

Permalink
Fix Eq geometry
Browse files Browse the repository at this point in the history
  • Loading branch information
hombit committed Sep 11, 2024
1 parent 6beaf65 commit 0e0d068
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
10 changes: 4 additions & 6 deletions src/healpix_geometry_analysis/geometry/equatorial.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,11 @@ def diagonal_indices(self, params: dict[str, object]) -> tuple[object, object, o
params["k1"],
params["k2"],
params["kp1"],
params["kp2_minus_kp1"] + params["kp1"],
params["kp2"],
)

parameter_names: tuple[str, str, str, str, str] = dataclasses.field(
init=False, default=("k1", "k2", "kp1", "kp2_minus_kp1")
init=False, default=("k1", "k2", "kp1", "kp2")
)

@property
Expand Down Expand Up @@ -115,7 +115,5 @@ def free_parameter_limits(self) -> dict[str, tuple[object, object]]:
"""
if self.direction != "p":
raise ValueError(f'Invalid direction: {self.direction}, must be one of "p"')
return {
"kp1": (0.5 * self.coord.grid.nside, self.coord.grid.nside * 1.5),
"kp2_minus_kp1": (-2.0 * self.delta, 2.0 * self.delta),
}
kp_range = (0.5 * self.coord.grid.nside, self.coord.grid.nside * 1.5)
return dict.fromkeys(["kp1", "kp2"], kp_range)
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def test_tile_problem_nuts():
def test_equatorial_problem_nuts():
"""e2e test for MeridianProblem with MCMC sampler"""
geometry = EquatorialGeometry.from_order(
order=8,
order=2,
distance="chord_squared",
)
problem = NumpyroSamplerProblem(geometry, track_arc_length=True)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ def test_tile_problem_adabelief():
assert arc_distance_deg < problem.geometry.coord.grid.average_pixel_size_degree


def test_meridian_problem_adamw():
"""e2e test for MeridianProblem with Adam optimizer with weight decay"""
def test_equatorial_problem_adamw():
"""e2e test for EquatorialProblem with Adam optimizer with weight decay"""
geometry = EquatorialGeometry.from_order(
order=8,
order=2,
distance="chord_squared",
)
problem = OptaxOptimizerProblem(geometry)
Expand Down

0 comments on commit 0e0d068

Please sign in to comment.