Skip to content

Commit

Permalink
MNT: Compat with numpy 2 and astropy 6.1 (#1130)
Browse files Browse the repository at this point in the history
  • Loading branch information
pllim authored Apr 5, 2024
1 parent dac04ca commit 5ec4931
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ Bug Fixes
Other Changes and Additions
^^^^^^^^^^^^^^^^^^^^^^^^^^^

- Compatibility with numpy 2.0 and astropy 6.1. [#1130]

1.13.0 (2024-02-19)
-------------------

Expand Down
4 changes: 3 additions & 1 deletion specutils/utils/quantity_model.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import numpy as np
from astropy import units as u

__all__ = ['QuantityModel']
_NUMPY_COPY_IF_NEEDED = False if np.__version__.startswith("1.") else None


class QuantityModel:
Expand Down Expand Up @@ -72,4 +74,4 @@ def __repr__(self):
def __call__(self, x, *args, **kwargs):
unitlessx = x.to(self.input_units).value
result = self.unitless_model(unitlessx, *args, **kwargs)
return u.Quantity(result, self.return_units, copy=False)
return u.Quantity(result, self.return_units, copy=_NUMPY_COPY_IF_NEEDED)

0 comments on commit 5ec4931

Please # to comment.