Skip to content

Commit

Permalink
convert to np.float64
Browse files Browse the repository at this point in the history
  • Loading branch information
haddadanas authored Nov 1, 2024
1 parent 5369de3 commit bf150eb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions columnflow/selection/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,15 +148,15 @@ def increment_stats(
f"but found a sequence: {obj}",
)
if len(obj) == 1:
weights = ak.values_astype(obj[0], float)
weights = ak.values_astype(obj[0], np.float64)
elif len(obj) == 2:
weights, weight_mask = ak.values_astype(obj[0], float), obj[1]
weights, weight_mask = ak.values_astype(obj[0], np.float64), obj[1]
else:
raise Exception(f"cannot interpret as weights and optional mask: '{obj}'")
elif op == self.NUM:
weight_mask = obj
else: # SUM
weights = ak.values_astype(obj, float)
weights = ak.values_astype(obj, np.float64)

# when mask is an Ellipsis, it cannot be AND joined to other masks, so convert to true mask
if weight_mask is Ellipsis:
Expand Down

0 comments on commit bf150eb

Please sign in to comment.