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

Replacing np.allclose #382

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from
Draft

Replacing np.allclose #382

wants to merge 1 commit into from

Conversation

davidorme
Copy link
Collaborator

Description

This PR is to replace the use of assert np.allclose in testing with np.testing.assert_allclose. The testing version checks that shapes are equal, where np.allclose allows broadcasting before testing values (see #380).

  • Replace calls in test_*.py files and import np.testing.assert_allclose.
  • "Fix" issues where previously passing tests now fail due to differences in default permitted tolerances. This PR does not change any of the package code, so no calculations differ: it is simply differences in the permitted tolerance and we accepted the values before.
  • Look at the new fails where the shape is not as expected and np.allclose let it pass.

Fixes #380 (issue)

Type of change

  • New feature (non-breaking change which adds functionality)
  • Optimization (back-end change that speeds up the code)
  • Bug fix (non-breaking change which fixes an issue)

Key checklist

  • Make sure you've run the pre-commit checks: $ pre-commit run -a
  • All tests pass: $ poetry run pytest

Further checks

  • Code is commented, particularly in hard-to-understand areas
  • Tests added that prove fix is effective or that feature works

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

Successfully merging this pull request may close these issues.

Replace usage of np.allclose in testing with assert_allclose
1 participant