Migrate to SciPy sparse arrays
Description
In recent versions of scipy, they have introduced sparse arrays (e.g., csc_array) that generalize the existing sparse matrix classes to N dimensions. The scipy documentation recommends migrating to using sparse arrays rather than sparse matrices. This PR completes that migration for OpenMC, preferentially using sparse arrays for scipy 1.15+ (when they became fully supported) and falling back to sparse matrices for earlier versions.
Checklist
- [x] I have performed a self-review of my own code
- [x]
I have run clang-format (version 15) on any C++ source files (if applicable) - [x] I have followed the style guidelines for Python source files (if applicable)
- [x] I have made corresponding changes to the documentation (if applicable)
- [x] I have added tests that prove my fix is effective or that my feature works (if applicable)
I guess another option is to change the pyproject.toml to ensure scipy 1.115.0 or newer is installed.
@shimwell We follow SPEC 0 with respect to minimum versions required, which currently says we should support scipy 1.12+
@eepeterson Correct, at the appropriate point we'll drop the compatibility module and just use the sparse array classes directly from scipy. Also thanks for pointing out those ones I missed in cmfd.py and tallies.py! Those have been updated now.
Changes in cmfd.py look good to me 👍🏾