Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

MNT: Compat with numpy 2 and astropy 6.1 #1130

Merged
merged 1 commit into from
Apr 5, 2024
Merged
Show file tree
Hide file tree
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
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)
Loading