Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix CDIPS parsing support (column filled with strings) #122

Merged
merged 3 commits into from
Jun 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,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 @@
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

Check warning on line 289 in lcviz/utils.py

View check run for this annotation

Codecov / codecov/patch

lcviz/utils.py#L287-L289

Added lines #L287 - L289 were not covered by tests
# values could have been an array of strings with units ""
values = values

Check warning on line 291 in lcviz/utils.py

View check run for this annotation

Codecov / codecov/patch

lcviz/utils.py#L291

Added line #L291 was not covered by tests

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