Closed speth closed 1 week ago
Is this backwards compatible? In other words, will Cantera 3.1 require NumPy >=2.0, or can we support 1.x and 2.x simultaneously?
This is meant to be backwards compatible, at least in terms of the source -- all the changes for us are pretty minor. I think the conda and PyPI packages will have to be specific to one version or another. I was hoping for your help in figuring some of that out. 😁
I think the conda and PyPI packages will have to be specific to one version or another. I was hoping for your help in figuring some of that out. 😁
Yeah, the NumPy headers are different, right? I haven't looked into how that's meant to be handled. I'll see if there's anything out there, I assume NumPy have gotten out ahead of this.
This may be easier than I thought. According to the NumPy Docs:
When you build wheels for your package using a NumPy 2.x version at build time, those will work with NumPy 1.xx.
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 72.83%. Comparing base (
9f48b07
) to head (8e2e1ce
).
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
One tricky thing I found here is that Pint 0.24 supports Python 3.10 and up, and only Pint >=0.24 supports NumPy 2.0. https://github.com/hgrecco/pint/commit/749d77c69abc755b374553fc7152df1c0a89e557 for the Python 3.10 stuff and I'm having test failures on Python 3.9 with cibuildwheel because it's installing 0.23.2 of Pint and 2.0 of NumPy.
I think the solution is to edit the setup.cfg
to force numpy<2.0
if the units extra is selected and Python is < 3.9
Thanks @speth I'm going to merge this and move any further work to #1713
Changes proposed in this pull request
Fix usage of functions that were removed or deprecated in NumPy 2.0.
We can make sure that at least some of the CI tests are using NumPy 2.0 once the official release is made on June 16 (https://github.com/numpy/numpy/issues/24300), and then merge this PR.
If applicable, fill in the issue number this pull request is fixing
Partially resolves #1675. I think the issues with matching versions of NumPy for packaged versions of Cantera will need to be resolved in the various packaging scripts, but we can leave the issue open until those changes are made.
If applicable, provide an example illustrating new features this pull request is introducing
Checklist
scons build
&scons test
) and unit tests address code coverage