Skip to content

Fix port of old-precision-decimal to present-atol in tests #2082

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

Merged
merged 4 commits into from
Jun 10, 2024

Conversation

echedey-ls
Copy link
Contributor

@echedey-ls echedey-ls commented Jun 6, 2024

  • Closes comment Change accuracy of pvsyst_cell test function #2080 (comment)
  • I am familiar with the contributing guidelines
  • [ ] Tests added
  • [ ] Updates entries in docs/sphinx/source/reference for API changes.
  • [ ] Adds description and name entries in the appropriate "what's new" file in docs/sphinx/source/whatsnew for all changes. Includes link to the GitHub Issue with :issue:`num` or this Pull Request with :pull:`num`. Includes contributor name and/or GitHub username (link with :ghuser:`user`).
  • [ ] New code is fully documented. Includes numpydoc compliant docstrings, examples, and comments where necessary.
  • Pull request is nearly complete and ready for detailed review.
  • Maintainer: Appropriate GitHub Labels (including remote-data) and Milestone are assigned to the Pull Request and linked Issue.

Some tests were using a tolerance higher than expected.

Feel free to find other occurrences with (assert_allclose)\((.*), ?(.*), ?([a-zA-Z0-9=]*)?(\d)\)

These are the left integer tolerances:
image
But I have played a bit with some of em and didn't think they are a misunderstood decimal position.

@echedey-ls echedey-ls marked this pull request as ready for review June 6, 2024 19:19
@echedey-ls echedey-ls changed the title Fix port of old-precision to present-atol in tests Fix port of old-precision-decimal to present-atol in tests Jun 6, 2024
@echedey-ls
Copy link
Contributor Author

echedey-ls commented Jun 7, 2024

This regex to show that we are talking either about assert_allclose or assert_frame_equal. Constrains finds to functions that start with assert_

(assert_.*)\((.*), ?(.*), ?([a-zA-Z0-9]*=)?(\d)\)$

EDIT:
To take into account multiline calls:

(assert_.*)\((.*),[ \n]*?(.*),[ \n]*?([a-zA-Z0-9]*=)?(\d)[ \n]*\)$

@cwhanse cwhanse added this to the 0.11.0 milestone Jun 7, 2024
Copy link
Member

@cwhanse cwhanse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm OK with the assert_allclose statements that aren't changing. These statements are in tests of PVSystem methods, where assert_called_with is the primary check. The assert_allclose statements are only intended to confirm that the results of the method are somewhat as expected.

@kandersolar
Copy link
Member

Thanks as always for the comprehensive codebase greps @echedey-ls!

@kandersolar kandersolar merged commit 1f36160 into pvlib:main Jun 10, 2024
32 checks passed
@AdamRJensen AdamRJensen added the GSoC Contributions related to Google Summer of Code. label Jun 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug GSoC Contributions related to Google Summer of Code. testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants