Skip to content

Commit

Permalink
fix: declare ordinate regardless
Browse files Browse the repository at this point in the history
  • Loading branch information
maffettone committed Apr 12, 2024
1 parent 306aa56 commit 1450345
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pdf_agents/agents.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ def unpack_run(self, run) -> Tuple[Union[float, ArrayLike], Union[float, ArrayLi
scaled_bkg = y.max() / self.background[1].max() * self.background[1]
y = y - scaled_bkg

ordinate = np.array(run.primary.data[self.roi_key]).flatten()
if self.roi is not None:
ordinate = np.array(run.primary.data[self.roi_key]).flatten()
idx_min = np.where(ordinate < self.roi[0])[0][-1] if len(np.where(ordinate < self.roi[0])[0]) else None
idx_max = np.where(ordinate > self.roi[1])[0][-1] if len(np.where(ordinate > self.roi[1])[0]) else None
else:
Expand Down

0 comments on commit 1450345

Please sign in to comment.