Skip to content

Commit

Permalink
Moving open_model to the init method, and updating lephare envs there…
Browse files Browse the repository at this point in the history
… too.
  • Loading branch information
drewoldag committed May 14, 2024
1 parent a6bb320 commit 52ded5c
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/rail/estimation/algos/lephare.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,17 +187,19 @@ def __init__(self, args, comm=None):
self.zmin = float(Z_STEP.split(",")[1])
self.zmax = float(Z_STEP.split(",")[2])
self.nzbins = int((self.zmax - self.zmin) / self.zstep)
CatEstimator.open_model(self, **self.config)

if self.config["run_dir"] == "None":
self.run_dir = self.model["run_dir"]
else:
self.run_dir = self.config["run_dir"]

Check warning on line 195 in src/rail/estimation/algos/lephare.py

View check run for this annotation

Codecov / codecov/patch

src/rail/estimation/algos/lephare.py#L195

Added line #L195 was not covered by tests
_update_lephare_env(None, self.run_dir)

def _process_chunk(self, start, end, data, first):
"""Process an individual chunk of sources using lephare
"""Process an individual chunk of sources using lephare.
Run the equivalent of zphota and get the PDF for every source.
"""
if self.config["run_dir"] == "None":
run_dir = self.model["run_dir"]
else:
run_dir = self.config["run_dir"]
_update_lephare_env(None, run_dir)
# Create the lephare input table
input = _rail_to_lephare_input(data, self.config.bands, self.config.err_bands)
# Set the desired offsets estimate config overide lephare config overide inform offsets
Expand Down

0 comments on commit 52ded5c

Please sign in to comment.