Skip to content

Commit

Permalink
NumPy: unified setting of scalars and ndarrays
Browse files Browse the repository at this point in the history
  • Loading branch information
berquist authored and dragly committed Sep 16, 2024
1 parent 381b3a4 commit 81e147c
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions exdir/core/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,7 @@ def _reset_data(self, value, attrs, meta):
shape=value.shape
)

if len(value.shape) == 0:
# scalars need to be set with itemset
self._data_memmap.itemset(value)
else:
# replace the contents with the value
self._data_memmap[:] = value
self._data_memmap[...] = value

# update attributes and plugin metadata
if attrs:
Expand Down

0 comments on commit 81e147c

Please sign in to comment.