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

unit tests #2

Closed
4 of 5 tasks
geoffwoollard opened this issue May 13, 2024 · 6 comments
Closed
4 of 5 tasks

unit tests #2

geoffwoollard opened this issue May 13, 2024 · 6 comments
Assignees

Comments

@geoffwoollard
Copy link
Collaborator

geoffwoollard commented May 13, 2024

use pytest to perform unit tests.

  • preprocess
  • SVD
  • map to map
  • distribution to distribution
  • testing notebooks (low priority). See here and here

see example of pytest the compSPI/simSPI repo https://github.com/compSPI/simSPI/blob/master/.github/workflows/test.yml

Suggestions

  • perform tests on subset of ground truth and submission data (e.g. 100 gt maps, 10 submitted maps), so that test runs in 10s - 1 min.
  • make use of data validators to pass/fail test
@geoffwoollard
Copy link
Collaborator Author

geoffwoollard commented Jun 20, 2024

Installs take 3.5 min because of installs. Reduced to ~2.5 in with pip caching.
#23

@geoffwoollard
Copy link
Collaborator Author

geoffwoollard commented Jun 24, 2024

@DavidHerreros please do implement this and open a PR to compare the time and see if it helps.

#23 (comment)

@DavidHerreros
Copy link
Collaborator

DavidHerreros commented Jun 25, 2024

@geoffwoollard

While working on caching the test files and python environment, I encountered and error related to dependency versions.

It seems that in the new GitHub workflows being executed while testing the new GitHub actions, Scipy 1.14.0 was being installed. It seems that this version is not compatible with the optimal transport package coming with the dependencies. However, the package is not limiting the Scipy version itself, leading to a runtime error.

In other runs of the GitHub actions, Scipy 1.13.1 was installed instead. Trying this other version fixes the issue, so I think it is a good time to manually limit the version range allowed for the packages downloaded when installing the project. I would not start with anything fancy (it is even possible to limit a package version depending on the python version itself from the toml file), probably just giving a maximum version will solve most of the installation cases.

I will start by limiting the Scipy version to scipy<=1.13.1 in the pyproject.toml file. To make the installation more robust, I would go through the GiHub Actions log files and check the version of the other packages that work fine, and add a similar restriction to them.

@geoffwoollard
Copy link
Collaborator Author

Good catch!

@geoffwoollard
Copy link
Collaborator Author

For testing the notebooks, it would be nice to have a test config and pass in paths (overwrite the interactive aspect).

@geoffwoollard
Copy link
Collaborator Author

Closing - continue discussion about testing plots in this issue: #42

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants