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

Addition of pytest case for not None values for frames and start/stop/step #4769

Merged

Conversation

talagayev
Copy link
Member

@talagayev talagayev commented Oct 27, 2024

Fixes #4648

Changes made in this Pull Request:

  • Added a pytest case in test_base.py to cover the case where frames and start/stop/step are both specified as not None, leading to an ValueError

PR Checklist

  • Tests?
  • Docs?
  • CHANGELOG updated?
  • Issue raised/referenced?

Developers certificate of origin


📚 Documentation preview 📚: https://mdanalysis--4769.org.readthedocs.build/en/4769/

Added pytest case where both frames and start/stop/step are present to raise valueerror
Updated changelog to add coverage of raise error case where frames and start/stop/step are present
@pep8speaks
Copy link

pep8speaks commented Oct 27, 2024

Hello @talagayev! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2024-11-27 16:01:33 UTC

Copy link

codecov bot commented Oct 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.66%. Comparing base (abc9806) to head (ba62187).
Report is 2 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #4769      +/-   ##
===========================================
- Coverage    93.68%   93.66%   -0.03%     
===========================================
  Files          177      189      +12     
  Lines        21742    22808    +1066     
  Branches      3055     3055              
===========================================
+ Hits         20368    21362     +994     
- Misses         927     1000      +73     
+ Partials       447      446       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@talagayev talagayev changed the title Frames values incompatability parallel Addition of pytest case for not None values for frames and start/stop/step Oct 27, 2024
Copy link
Member

@hmacdope hmacdope left a comment

Choose a reason for hiding this comment

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

LGTM @talagayev!

Copy link
Member

@IAlibay IAlibay left a comment

Choose a reason for hiding this comment

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

Happy to discuss this further, but would prefer if we didn't fill up the changelog with small test changes.

package/CHANGELOG Outdated Show resolved Hide resolved
removed Changelog change
@talagayev
Copy link
Member Author

talagayev commented Oct 29, 2024

now that I was working on a different Issue I noticed that test_frame_fail in test_base.py possibly already covers the Issue #4648

@RMeli
Copy link
Member

RMeli commented Nov 27, 2024

@talagayev can you please resolve the conflict? Thanks.

@talagayev
Copy link
Member Author

@RMeli it's now good to go :)

Copy link
Member

@RMeli RMeli left a comment

Choose a reason for hiding this comment

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

Thanks @talagayev.

Note for other reviewers: formatting will be sorted down the line, so I'm approving as-is.

@talagayev
Copy link
Member Author

Thanks @talagayev.

Note for other reviewers: formatting will be sorted down the line, so I'm approving as-is.

Happy to help :)

For the formatting for any upcoming PRs, I can run black through the added code if this would be preferred, or is
there any preference if it is formatted down the line ?

@RMeli
Copy link
Member

RMeli commented Nov 27, 2024

For the formatting for any upcoming PRs, I can run black through the added code if this would be preferred, or is there any preference if it is formatted down the line ?

Up to you, but in such case black should only affect the added code, not the whole file. We are using black too, as set up in #4725. However, we are formatting one module at a time so that we can actually check what black is doing.

So either way is fine. If you don't format what you are writing, it will be automatically formatted with black eventually.

@talagayev
Copy link
Member Author

For the formatting for any upcoming PRs, I can run black through the added code if this would be preferred, or is there any preference if it is formatted down the line ?

Up to you, but in such case black should only affect the added code, not the whole file. We are using black too, as set up in #4725. However, we are formatting one module at a time so that we can actually check what black is doing.

So either way is fine. If you don't format what you are writing, it will be automatically formatted with black eventually.

Ah I see, will then run it for the code snippets that I add, although I got a feeling that sometimes PEP8 has some small complaints for some black formatting

@RMeli
Copy link
Member

RMeli commented Nov 28, 2024

Yes, this page details how to use black with other tools: https://black.readthedocs.io/en/stable/guides/using_black_with_other_tools.html

I'll give @IAlibay a chance to review, but don't worry about the formatting.

@talagayev
Copy link
Member Author

Yes, this page details how to use black with other tools: https://black.readthedocs.io/en/stable/guides/using_black_with_other_tools.html

I'll give @IAlibay a chance to review, but don't worry about the formatting.

Ah I see, thanks for the link, will take a look at it :)

Copy link
Member

@IAlibay IAlibay left a comment

Choose a reason for hiding this comment

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

Sorry didn't realise I was blocking here, lgtm.

@RMeli RMeli merged commit 905f197 into MDAnalysis:develop Nov 28, 2024
23 of 24 checks passed
@talagayev talagayev deleted the frames_values_incompatability_parallel branch November 28, 2024 22:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Test incompatibility of start/stop/step and frames in AnalysisBase.run(...)
5 participants