Skip to content

Commit

Permalink
Adjusting Field creation due to change in NumPy
Browse files Browse the repository at this point in the history
  • Loading branch information
stammler committed Jun 30, 2024
1 parent 13836da commit 3cb2646
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion simframe/frame/field.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ def __new__(cls, owner, value, updater=None, differentiator=None, jacobinator=No
If False the field is not written into output files
copy : boolean, optional, default : False
If True <value> will be copied, not referenced"""
obj = np.array(value, copy=copy).view(cls)
if copy:
obj = np.array(value, copy=True).view(cls)
else:
obj = np.asarray(value).view(cls)
if obj.size == 1:
obj = obj.squeeze()
obj._owner = owner
Expand Down

0 comments on commit 3cb2646

Please sign in to comment.