Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent a possible clash with SciPy 1.12's FMM #63

Merged
merged 3 commits into from
Dec 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,13 @@ jobs:

- name: Install NumPy
# --only-binary disables compiling the package from source if a binary wheel is not available, such as some versions of PyPy
run: pip install --only-binary ":all:" numpy || true
# `--pre` to test against RCs, if any
run: pip install --pre --only-binary ":all:" numpy || true

- name: Install SciPy
# --only-binary disables compiling the package from source if a binary wheel is not available, such as PyPy
run: pip install --only-binary ":all:" scipy || true
# `--pre` to test against RCs, if any
run: pip install --pre --only-binary ":all:" scipy || true

- name: Python Test
working-directory: python/tests
Expand Down
6 changes: 3 additions & 3 deletions python/src/fast_matrix_market/_fmm_core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ PYBIND11_MODULE(_fmm_core, m) {
}
});

py::class_<fmm::matrix_market_header>(m, "header")
py::class_<fmm::matrix_market_header>(m, "header", py::module_local())
#ifndef FMM_SCIPY_PRUNE
.def(py::init<>())
.def(py::init<int64_t, int64_t>())
Expand Down Expand Up @@ -224,7 +224,7 @@ PYBIND11_MODULE(_fmm_core, m) {
#endif
///////////////////////////////
// Read methods
py::class_<read_cursor>(m, "_read_cursor")
py::class_<read_cursor>(m, "_read_cursor", py::module_local())
.def_readonly("header", &read_cursor::header)
.def("close", &read_cursor::close);

Expand All @@ -236,7 +236,7 @@ PYBIND11_MODULE(_fmm_core, m) {

///////////////////////////////
// Write methods
py::class_<write_cursor>(m, "_write_cursor")
py::class_<write_cursor>(m, "_write_cursor", py::module_local())
#ifndef FMM_SCIPY_PRUNE
.def_readwrite("header", &write_cursor::header)
#endif
Expand Down
2 changes: 2 additions & 0 deletions python/tests/test_scipy.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ def test_read_array_or_coo(self):

self.assertMatrixEqual(m, m_fmm)

@unittest.skipIf(scipy is None or not scipy.__version__.startswith("1.11"),
"SciPy 1.12 ships FMM so this no longer crashes.")
def test_scipy_crashes(self):
for mtx in sorted(list((matrices / "scipy_crashes").glob("*.mtx*"))):
with self.subTest(msg=mtx.stem):
Expand Down