Skip to content

Commit

Permalink
Got tests passing faster by setting redshift grid via informer
Browse files Browse the repository at this point in the history
  • Loading branch information
Raphael Shirley committed May 16, 2024
1 parent f687f87 commit 32efdca
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/rail/estimation/algos/lephare.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,12 @@ def __init__(self, args, comm=None):
CatInformer.__init__(self, args, comm=comm)
self.lephare_config = self.config["lephare_config"]
# We need to ensure the requested redshift grid is propagated
self.zmin=self.config["zmin"]
self.zmax=self.config["zmax"]
self.nzbins=self.config["nzbins"]
self.dz=(self.zmax-self.zmin)/(self.nzbins-1)
Z_STEP=f"{self.dz},{self.zmin},{self.zmax}"
print(f"rail_lephare is setting the z grid to {Z_STEP} based on the informer params.")
print(f"rail_lephare is setting the Z_STEP config to {Z_STEP} based on the informer params.")
self.config["lephare_config"]['Z_STEP']=Z_STEP
# We create a run directory with the informer name
self.run_dir = _set_run_dir(self.config["name"])
Expand Down
4 changes: 4 additions & 0 deletions tests/lephare/test_algos.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ def test_informer_and_estimator(test_data_dir: str):
model="lephare.pkl",
hdf5_groupname="",
lephare_config=lp.keymap_to_string_dict(lephare_config),
# Use a very sparse redshift grid to speed up test:
zmin=0,
zmax=5,
nzbins=6,
)

inform_lephare.inform(traindata_io)
Expand Down

0 comments on commit 32efdca

Please sign in to comment.