Skip to content

Commit

Permalink
More experimentation to get the iterators to work correctly.
Browse files Browse the repository at this point in the history
  • Loading branch information
drewoldag committed Nov 29, 2023
1 parent bbdb36b commit 7f196ea
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/rail/core/stage.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]]
Expand Down
6 changes: 4 additions & 2 deletions src/rail/evaluation/dist_to_point_evaluator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand All @@ -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):
Expand Down

0 comments on commit 7f196ea

Please sign in to comment.