Skip to content

Commit d1c52be

Browse files
kecnrymeeseeksmachine
authored andcommitted
Backport PR spacetelescope#122: fix CDIPS parsing support (column filled with strings)
1 parent fcf0785 commit d1c52be

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

CHANGES.rst

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
0.4.1 (unreleased)
55
------------------
66

7+
* Fixes CDIPS support by handling columns filled with strings with empty units. [#122]
8+
79
0.4.0 (06-11-2024)
810
------------------
911

lcviz/utils.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,13 @@ def to_object(self, data_or_subset):
282282
if len(values) and isinstance(values[0], Time):
283283
values = Time(values.base)
284284
elif hasattr(component, 'units') and component.units != "None":
285-
values = u.Quantity(values, component.units)
285+
try:
286+
values = u.Quantity(values, component.units)
287+
except TypeError:
288+
if component.units != "":
289+
raise
290+
# values could have been an array of strings with units ""
291+
values = values
286292

287293
if component_id.label not in names:
288294
columns.append(values)

0 commit comments

Comments
 (0)