Skip to content

Commit

Permalink
Merge pull request #159 from SWIFTSIM/unyt_3
Browse files Browse the repository at this point in the history
Added new superclass for unyt3.0 behaviour
  • Loading branch information
JBorrow authored Jun 5, 2023
2 parents 02444f6 + cfb875f commit 068d08e
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion swiftsimio/objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -730,6 +730,17 @@ def __new__(
cosmo_factor: cosmo_factor

try:
obj = super().__new__(
cls,
input_array,
units=units,
registry=registry,
dtype=dtype,
bypass_validation=bypass_validation,
name=name,
)
except TypeError:
# Older versions of unyt (before input_units was deprecated)
obj = super().__new__(
cls,
input_array,
Expand All @@ -741,7 +752,7 @@ def __new__(
name=name,
)
except TypeError:
# Older versions of unyt
# Even older versions of unyt (before name was added)
obj = super().__new__(
cls,
input_array,
Expand Down

0 comments on commit 068d08e

Please sign in to comment.