Skip to content

Commit

Permalink
Testing hdf5_groupname with ifs
Browse files Browse the repository at this point in the history
  • Loading branch information
joselotl authored and eacharles committed Apr 2, 2024
1 parent 8c9ad39 commit 298aba7
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/rail/evaluation/evaluator.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class Evaluator(RailStage):
nzbins=Param(int, 301, msg="# of bins in zgrid"),
pit_metrics=Param(str, 'all', msg='PIT-based metrics to include'),
point_metrics=Param(str, 'all', msg='Point-estimate metrics to include'),
hdf5_groupname=SHARED_PARAMS['hdf5_groupname'],
do_cde=Param(bool, True, msg='Evaluate CDE Metric'),
redshift_col=SHARED_PARAMS)
inputs = [('input', QPHandle),
Expand Down Expand Up @@ -79,10 +80,12 @@ def run(self):
"""

pz_data = self.get_data('input')
try: #pragma: no cover
z_true = self.get_data('truth')[self.config.hdf5_groupname][self.config.redshift_col]
except:
z_true = self.get_data('truth')[self.config.redshift_col]
if self.config.hdf5_groupname:
specz_data = self.get_data('truth')[self.config.hdf5_groupname]
else:
specz_data = self.get_data('truth')
z_true = specz_data[self.config['redshift_col']]

zgrid = np.linspace(self.config.zmin, self.config.zmax, self.config.nzbins+1)

# Create an instance of the PIT class
Expand Down

0 comments on commit 298aba7

Please sign in to comment.