diff --git a/CHANGES.rst b/CHANGES.rst index f7462f670..1dd1bafd0 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,3 +1,20 @@ +1.8.1 (2024-09-08) +================== + +Bug Fixes +--------- + +- Fixed memory leak in C-extension. (`#281 + `_) + + +General +------- + +- use ``towncrier`` to handle changelog entries (`#284 + `_) + + 1.8.0 (2024-08-14) ================== diff --git a/changes/281.bugfix.rst b/changes/281.bugfix.rst deleted file mode 100644 index 1535f2deb..000000000 --- a/changes/281.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Fixed memory leak in C-extension. diff --git a/changes/282.bugfix.rst b/changes/282.bugfix.rst new file mode 100644 index 000000000..d7394df4d --- /dev/null +++ b/changes/282.bugfix.rst @@ -0,0 +1 @@ +Implement byteorder swap method that is forward-compatible with numpy 2.0 in jwst ramp_fitting. \ No newline at end of file diff --git a/changes/284.general.rst b/changes/284.general.rst deleted file mode 100644 index 5019825fe..000000000 --- a/changes/284.general.rst +++ /dev/null @@ -1 +0,0 @@ -use ``towncrier`` to handle changelog entries diff --git a/src/stcal/ramp_fitting/ols_fit.py b/src/stcal/ramp_fitting/ols_fit.py index 1473dd864..8d95e3690 100644 --- a/src/stcal/ramp_fitting/ols_fit.py +++ b/src/stcal/ramp_fitting/ols_fit.py @@ -687,9 +687,9 @@ def ols_ramp_fit_single(ramp_data, buffsize, save_opt, readnoise_2d, gain_2d, we # ramp fitting. rn_bswap, gain_bswap = bswap if rn_bswap: - readnoise_2d.newbyteorder('S').byteswap(inplace=True) + readnoise_2d.view(readnoise_2d.dtype.newbyteorder('S')).byteswap(inplace=True) if gain_bswap: - gain_2d.newbyteorder('S').byteswap(inplace=True) + gain_2d.view(gain_2d.dtype.newbyteorder('S')).byteswap(inplace=True) c_diff = c_end - c_start log.info(f"Ramp Fitting C Time: {c_diff}") @@ -731,7 +731,7 @@ def handle_array_endianness(arr, sys_order): arr_order = arr.dtype.byteorder bswap = False if (arr_order == ">" and sys_order == "<") or (arr_order == "<" and sys_order == ">"): - arr.newbyteorder('S').byteswap(inplace=True) + arr.view(arr.dtype.newbyteorder('S')).byteswap(inplace=True) bswap = True return arr, bswap