Skip to content
Merged
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
9 changes: 6 additions & 3 deletions imas/backends/netcdf/nc2ids.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,9 +366,12 @@ def get_child(self, child):

if value is not None:
if isinstance(value, np.ndarray):
# Convert the numpy array to a read-only view
value = value.view()
value.flags.writeable = False
if value.ndim == 0: # Unpack 0D numpy arrays:
value = value.item()
else:
# Convert the numpy array to a read-only view
value = value.view()
value.flags.writeable = False
# NOTE: bypassing IDSPrimitive.value.setter logic
child._IDSPrimitive__value = value

Expand Down
Loading