From 7f196eac49be4ca92264cc54b726c7c06838456b Mon Sep 17 00:00:00 2001 From: drewoldag <47493171+drewoldag@users.noreply.github.com> Date: Tue, 28 Nov 2023 16:04:16 -0800 Subject: [PATCH] More experimentation to get the iterators to work correctly. --- src/rail/core/stage.py | 4 ++-- src/rail/evaluation/dist_to_point_evaluator.py | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/rail/core/stage.py b/src/rail/core/stage.py index 5c37c3bc..29e41f17 100644 --- a/src/rail/core/stage.py +++ b/src/rail/core/stage.py @@ -355,9 +355,9 @@ def input_iterator(self, tag, **kwargs): # in a single chunk. else: #pragma: no cover if self.config.hdf5_groupname: - test_data = self.get_data('input')[self.config.hdf5_groupname] + test_data = self.get_data(tag)[self.config.hdf5_groupname] else: - test_data = self.get_data('input') + test_data = self.get_data(tag) self._input_length = len(test_data) s = 0 iterator=[[s, self._input_length, test_data]] diff --git a/src/rail/evaluation/dist_to_point_evaluator.py b/src/rail/evaluation/dist_to_point_evaluator.py index 3bd725ec..39f74744 100644 --- a/src/rail/evaluation/dist_to_point_evaluator.py +++ b/src/rail/evaluation/dist_to_point_evaluator.py @@ -32,6 +32,8 @@ class DistToPointEvaluator(Evaluator): msg="The x-value grid at which to evaluate the pdf values."), _random_state=Param(float, default=None, required=False, msg="Random seed value to use for reproducible results."), + hdf5_groupname=Param(str, "photometry", required=False, + msg="HDF5 Groupname for truth table."), ) inputs = [('input', QPHandle), ('truth', TableHandle)] @@ -45,8 +47,8 @@ def __init__(self, args, comm=None): def run(self): print(f"Requested metrics: {self.config.metrics}") - estimate_iterator = self.get_handle('input').iterator() - reference_iterator = self.get_handle('truth').iterator() + estimate_iterator = self.input_iterator('input') + reference_iterator = self.input_iterator('truth') first = True for s, e, estimate_data, _, _, reference_data in zip(estimate_iterator, reference_iterator):