Skip to content

Commit b0226b7

Browse files
authored
fix CDIPS parsing support (column filled with strings) (#122)
* fix units with empty strings affects CDIPS HLSP light curves * changelog entry * more robust handling that still accepts unitless empty string
1 parent 2236ade commit b0226b7

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
@@ -6,6 +6,8 @@
66
0.4.1 (unreleased)
77
------------------
88

9+
* Fixes CDIPS support by handling columns filled with strings with empty units. [#122]
10+
911
0.4.0 (06-11-2024)
1012
------------------
1113

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)