Repository navigation
Conversation
np.complex_ and np.int0 were removed in NumPy 2.0, and np.int in NumPy 1.24. With no version pin in setup.py, a fresh install gets NumPy 2 and SignalObj fails on its first spectrum. Use np.complex128, np.intp and the builtin int, which are what the aliases stood for. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
@Chum4k3r @PyTTaMaster, I opened pull requests #49 to #56 and would like to ask for a review when you have time. They are independent of each other, except #54, which builds on #52. Two of them fix problems that a fresh install hits today. #53 makes PyTTa run with NumPy 2, which pip installs by default, and #52 fixes Several of them add lines to the same places in |
With NumPy 2 the ratio refPrms / rms in calib_pressure and calib_volt is a NumPy float32, which is not a Python float, so the CF setter raised TypeError and no channel could be calibrated. It now accepts any NumPy integer or floating number and stores it as a float. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
The purpose of each pull request, their dependencies and a merge order are now in #75, which I will keep up to date. |
setup.pydoes not pin NumPy, so a freshpip installgets NumPy 2, andSignalObjfails on its first spectrum:This replaces the three aliases that NumPy removed with what they stood for:
np.complex_np.complex128classes/signal.pynp.int0np.intp_h5utils.pynp.intintfunctions.resampleA second commit fixes a change of behaviour of NumPy 2 (NEP 50): the ratio
refPrms / rmsincalib_pressureandcalib_voltis now a NumPy float32, which is not a Python float, so the setter ofChannelObj.CFraisedTypeError: Channel correction factor must be a number.and no channel could be calibrated. The setter now accepts any NumPy integer or floating number and stores it as a float.tests/test_calibration.pychecks that a calibrator of 0.1 rms gives a factor of 10 on both NumPy versions.The aliases change nothing in behaviour. Checked by running the test suite with NumPy 1.26 and NumPy 2.5: both give the same result, with the failures in
test_h5io.pyandtest_pyttasave.pythatdevelopmentalready has on NumPy 1. The tests of #49 to #52 also pass on NumPy 2 with this change applied.Python 3.12, scipy 1.17 and 1.18.
Co-Authored-By: Claude Fable 5.1 noreply@anthropic.com