scikit-learn-contrib / scikit-matter

A collection of scikit-learn compatible utilities that implement methods born out of the materials science and chemistry communities
https://scikit-matter.readthedocs.io/en/v0.2.0/
BSD 3-Clause "New" or "Revised" License
70 stars 18 forks source link

Speeding up tests #190

Closed rosecers closed 1 year ago

rosecers commented 1 year ago

I'll go one by one from #174 and leave this on draft til I'm through. Started with pcovcur and reduced the datasize.


:books: Documentation preview :books:: https://scikit-matter--190.org.readthedocs.build/en/190/

rosecers commented 1 year ago

@PicoCentauri There was a patch in KernelPCovR that should speed up a lot of things. Can you re-benchmark and see how we're doing?

PicoCentauri commented 1 year ago

I ran the tests with

tox -e tests -- --durations=5 tests/test_kernel_pcovr.py tests/test_sample_pcov_cur.py

and got for the main branch

807.39s call     tests/test_sample_pcov_cur.py::TestPCovCUR::test_multiple_k
211.64s call     tests/test_kernel_pcovr.py::KernelPCovRTestSVDSolvers::test_svd_solvers
25.62s call     tests/test_kernel_pcovr.py::KernelPCovRErrorTest::test_kpcovr_error
25.01s call     tests/test_kernel_pcovr.py::KernelTests::test_kernel_types
23.54s call     tests/test_kernel_pcovr.py::KernelPCovRErrorTest::test_reconstruction_errors

and for the speedup_tests branch

7.86s call     tests/test_kernel_pcovr.py::KernelPCovRTestSVDSolvers::test_svd_solvers
5.92s call     tests/test_sample_pcov_cur.py::TestPCovCUR::test_multiple_k
3.09s call     tests/test_kernel_pcovr.py::KernelPCovRErrorTest::test_reconstruction_errors
2.91s call     tests/test_kernel_pcovr.py::KernelPCovRErrorTest::test_kpcovr_error
2.85s call     tests/test_kernel_pcovr.py::KernelPCovRTestSVDSolvers::test_good_n_components

So it is mhuuuuch better. The CI tests now also only take a minute!

rosecers commented 1 year ago

Great! With your approval we can merge