Skip to content

Commit

Permalink
TMP: expose traceback for incompat unit conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
kecnry committed Apr 19, 2024
1 parent 692970d commit fa3c517
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lcviz/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ def equivalent_units(self, data, cid, units):
def to_unit(self, data, cid, values, original_units, target_units):
# for some reason, glue is trying to request a change for cid='flux' from d to electron / s
if target_units not in self.equivalent_units(data, cid, original_units):
raise ValueError(f"to_unit cannot convert units, cid={cid}, original_units={original_units}, target_units={target_units}") # noqa
return values
return (values * u.Unit(original_units)).to_value(u.Unit(target_units))

Expand Down

0 comments on commit fa3c517

Please sign in to comment.