Skip to content

Commit

Permalink
Merge pull request #381 from Renumics/fix/read-external-data-from-h5-…
Browse files Browse the repository at this point in the history
…in-spotlight

Read external data in H5 data source
  • Loading branch information
druzsan authored Nov 22, 2023
2 parents 9f6b824 + 9f97ccf commit 331c831
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions renumics/spotlight_plugins/core/hdf5_data_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,14 +110,17 @@ def get_column_values(
raw_values = np.array([x.decode("utf-8") for x in raw_values])

if self._table._is_ref_column(column):
if not is_string_dtype:
if column.attrs.get("external", False):
yield from raw_values
elif is_string_dtype:
for ref in raw_values:
if not ref:
yield None
else:
value = self._table._resolve_ref(ref, column_name)[()]
yield value.tolist() if isinstance(value, np.void) else value
else:
raise H5DatasetOutdated()
for ref in raw_values:
if not ref:
yield None
else:
value = self._table._resolve_ref(ref, column_name)[()]
yield value.tolist() if isinstance(value, np.void) else value
elif dtypes.is_window_dtype(dtype) or dtypes.is_bounding_box_dtype(dtype):
for x in raw_values:
yield None if np.isnan(x).all() else x
Expand Down

0 comments on commit 331c831

Please sign in to comment.