Skip to content

Commit

Permalink
Merge branch 'main' into jp-3689
Browse files Browse the repository at this point in the history
  • Loading branch information
tapastro committed Sep 10, 2024
2 parents ac0ae67 + eb35e2a commit 3b0f596
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 5 deletions.
17 changes: 17 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
1.8.1 (2024-09-08)
==================

Bug Fixes
---------

- Fixed memory leak in C-extension. (`#281
<https://github.com/spacetelescope/stcal/issues/281>`_)


General
-------

- use ``towncrier`` to handle changelog entries (`#284
<https://github.com/spacetelescope/stcal/issues/284>`_)


1.8.0 (2024-08-14)
==================

Expand Down
1 change: 0 additions & 1 deletion changes/281.bugfix.rst

This file was deleted.

1 change: 1 addition & 0 deletions changes/282.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Implement byteorder swap method that is forward-compatible with numpy 2.0 in jwst ramp_fitting.
1 change: 0 additions & 1 deletion changes/284.general.rst

This file was deleted.

6 changes: 3 additions & 3 deletions src/stcal/ramp_fitting/ols_fit.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 3b0f596

Please sign in to comment.