Skip to content

Commit

Permalink
Backport PR #122: fix CDIPS parsing support (column filled with strings)
Browse files Browse the repository at this point in the history
  • Loading branch information
kecnry authored and meeseeksmachine committed Jun 28, 2024
1 parent fcf0785 commit d1c52be
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
0.4.1 (unreleased)
------------------

* Fixes CDIPS support by handling columns filled with strings with empty units. [#122]

0.4.0 (06-11-2024)
------------------

Expand Down
8 changes: 7 additions & 1 deletion lcviz/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,13 @@ def to_object(self, data_or_subset):
if len(values) and isinstance(values[0], Time):
values = Time(values.base)
elif hasattr(component, 'units') and component.units != "None":
values = u.Quantity(values, component.units)
try:
values = u.Quantity(values, component.units)
except TypeError:
if component.units != "":
raise
# values could have been an array of strings with units ""
values = values

if component_id.label not in names:
columns.append(values)
Expand Down

0 comments on commit d1c52be

Please sign in to comment.