From fa3c517f925187f68c11e557a1c7bf3af50bad81 Mon Sep 17 00:00:00 2001 From: Kyle Conroy Date: Fri, 19 Apr 2024 19:03:44 -0400 Subject: [PATCH] TMP: expose traceback for incompat unit conversion --- lcviz/helper.py | 1 + 1 file changed, 1 insertion(+) diff --git a/lcviz/helper.py b/lcviz/helper.py index 586675e..3ef2a62 100644 --- a/lcviz/helper.py +++ b/lcviz/helper.py @@ -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))