Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

JP-3589: fixed deprecated code from numpy 2.0 release #8415

Merged
merged 2 commits into from
Apr 10, 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
10 changes: 10 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
1.14.1 (unreleased)
===================

ami
---

- Replaced deprecated ``np.mat()`` with ``np.asmatrix()``. [#8415]

associations
------------

Expand All @@ -16,6 +21,11 @@ documentation
- Added docs for the NIRSpec MSA metadata file to the data products area of RTD.
[#8399]

extract_1d
----------

- Replaced deprecated ``np.trapz`` with ``np.trapezoid()``. [#8415]

pipeline
--------

Expand Down
6 changes: 3 additions & 3 deletions jwst/ami/leastsqnrm.py
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@
from linearfit import linearfit

# dependent variables
M = np.mat(flatimg)
M = np.asmatrix(flatimg)

Check warning on line 618 in jwst/ami/leastsqnrm.py

View check run for this annotation

Codecov / codecov/patch

jwst/ami/leastsqnrm.py#L618

Added line #L618 was not covered by tests

# photon noise
noise = np.sqrt(np.abs(flatimg))
Expand All @@ -625,9 +625,9 @@

# uniform weight
wy = weights
S = np.mat(np.diag(wy))
S = np.asmatrix(np.diag(wy))

Check warning on line 628 in jwst/ami/leastsqnrm.py

View check run for this annotation

Codecov / codecov/patch

jwst/ami/leastsqnrm.py#L628

Added line #L628 was not covered by tests
# matrix of independent variables
C = np.mat(flatmodeltransp)
C = np.asmatrix(flatmodeltransp)

Check warning on line 630 in jwst/ami/leastsqnrm.py

View check run for this annotation

Codecov / codecov/patch

jwst/ami/leastsqnrm.py#L630

Added line #L630 was not covered by tests

# initialize object
result = linearfit.LinearFit(M, S, C)
Expand Down
2 changes: 1 addition & 1 deletion jwst/extract_1d/soss_extract/atoca.py
Original file line number Diff line number Diff line change
Expand Up @@ -1485,7 +1485,7 @@

# Integrate
integrand = fct_f_k(x_grid) * x_grid
bin_val.append(np.trapz(integrand, x_grid))
bin_val.append(np.trapezoid(integrand, x_grid))

Check warning on line 1488 in jwst/extract_1d/soss_extract/atoca.py

View check run for this annotation

Codecov / codecov/patch

jwst/extract_1d/soss_extract/atoca.py#L1488

Added line #L1488 was not covered by tests

# Convert to array and return with the pixel centers.
return pix_center, np.array(bin_val)
Expand Down