Migrate Fortran to Numba and general upgrades#94
Conversation
|
No longer getting float128 errors. Thank you! |
|
Installs successfully for me using |
There was a problem hiding this comment.
Pull Request Overview
This PR replaces Fortran-based routines with Numba implementations, updates project tooling, and modernizes code to run under Python 3.12/3.13 with latest dependencies.
- Introduce Numba-compiled modules (
spectral_basis.py,sem_derivatives.py) to remove Fortran dependencies. - Migrate packaging to
pyproject.toml, switch linting from Flake8 to Ruff, and update CI to GitHub Actions. - Update Tornado fixtures and server code to use asyncio event loops and PySide6 for the UI.
Reviewed Changes
Copilot reviewed 78 out of 139 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/tornado_testing_fixtures.py | Updated I/O loop fixture to use asyncio loops and clear them |
| tests/conftest.py | Refactored xdist support, renamed test data directory path |
| src/instaseis/spectral_basis.py | Added Numba jitted 2D Lagrange interpolation replacing Fortran |
| src/instaseis/rotations.py | Switched tensor rotation routines from np.float128 to float64 |
| src/instaseis/server/routes/__init__.py | Set custom AnyThreadEventLoopPolicy for Tornado threading |
Comments suppressed due to low confidence (1)
src/instaseis/rotations.py:72
- Switching from
np.float128tonp.float64reduces numeric precision and may introduce subtle errors in rotation calculations. If quad precision was necessary for stability, consider retainingnp.float128or documenting and testing the impact of this downsizing.
R = np.require(R, dtype=np.float64) # NOQA
larsgeb
left a comment
There was a problem hiding this comment.
This is great, thanks for making Instaseis easier to use!
I had no problems doing a pip install of Instaseis (without any compilation headaches). Tests ran well. On a MacOS ARM system.
The addition of modern tooling like Ruff is also very welcome. How about adding this to the tests dependencies so the local dev environment can also run this out of the box?
Not sure what is typical for projects like this, but maybe the license files deserves a bump in year? Or would you say it is linked only to the original year? This was a decent amount of work and it should be clear that the project is still maintained.
Good to maybe add an issue with a deadline in two years to raise the minimum Python version beyond 3.11.
|
Thanks @larsgeb for the suggestions! All are implemented! |
This MR does a few things:
pipnow on most systems.setup.py->pyproject.toml.flake8toruff.pyside6andpyqtgraph.