Recent PRs are failing on CMFD tests due to the release of scipy 1.13. This PR adds a few fixes to get those tests working again:
The indptr attribute of sparse data structures in scipy 1.13 is now an array with int64, instead of int32. OpenMC C API functions accept int32s, so the indptr arrays need to be cast first.
Constructing a CSR matrix before would always result in underlying arrays that were sorted by index within a given row, but with scipy 1.13 that doesn't seem to be the case. There is evidently an implicit assumption in OpenMC that CSR data coming in is sorted, so I had to add explicit calls to sort_indices() to get it working (otherwise it fails on the Gauss-Seidel iteration).
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)
Description
Recent PRs are failing on CMFD tests due to the release of scipy 1.13. This PR adds a few fixes to get those tests working again:
indptr
attribute of sparse data structures in scipy 1.13 is now an array with int64, instead of int32. OpenMC C API functions accept int32s, so theindptr
arrays need to be cast first.sort_indices()
to get it working (otherwise it fails on the Gauss-Seidel iteration).Checklist
I have run clang-format (version 15) on any C++ source files (if applicable)I have made corresponding changes to the documentation (if applicable)I have added tests that prove my fix is effective or that my feature works (if applicable)