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

Adding smaller test data #55

Merged
merged 12 commits into from
Nov 6, 2022

Conversation

BFedder
Copy link
Collaborator

@BFedder BFedder commented Aug 2, 2022

I'm for now just using this PR to trigger codecov, as this is the fastest way I know to determine coverage.

To make the pyedr test files smaller, I added the edr test file I created for the EDRReader and changed the tests for pyedr accordingly. The tests now pass, but I want to make sure that the much smaller file still triggers all of the same code to be tested.

@pep8speaks
Copy link

pep8speaks commented Aug 2, 2022

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

Line 117:9: E265 block comment should start with '# '
Line 118:9: E265 block comment should start with '# '
Line 119:9: E265 block comment should start with '# '

Comment last updated at 2022-08-02 10:23:10 UTC

@codecov
Copy link

codecov bot commented Aug 2, 2022

Codecov Report

Base: 87.68% // Head: 82.97% // Decreases project coverage by -4.71% ⚠️

Coverage data is based on head (836e754) compared to base (45158cf).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #55      +/-   ##
==========================================
- Coverage   87.68%   82.97%   -4.72%     
==========================================
  Files           5        3       -2     
  Lines         406      276     -130     
==========================================
- Hits          356      229     -127     
+ Misses         50       47       -3     
Impacted Files Coverage Δ
pyedr/pyedr/pyedr.py 82.19% <100.00%> (-0.53%) ⬇️
pyedr/pyedr/tests/datafiles.py
pyedr/pyedr/tests/test_edr.py

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@BFedder
Copy link
Collaborator Author

BFedder commented Aug 2, 2022

Okay, so coverage of panedr.py and pyedr.py appears to be unaffected. Should we replace the test data files then, or am I missing a reason why that would be a bad idea?

@hmacdope
Copy link
Member

hmacdope commented Aug 2, 2022

Not in my mind as long as you clarify how the files are different (both here and possible in a README also?)

@IAlibay
Copy link
Member

IAlibay commented Aug 2, 2022

@hmacdope - It all depends on how small the package gets with it, if the package is still > a couple of MB when inflated then it's not worth it. The whole point of pyedr was that pandas was too heavy a dependency. We're breaking that idea if we just end up adding more tests.

If we don't package the tests then reducing the test sizes don't matter (in fact you just end up using more git history space).

@BFedder
Copy link
Collaborator Author

BFedder commented Aug 2, 2022

The new files are from a very short simulation of lysozyme that I ran just to get them. If we do go ahead and replace cat.edr and cat.xvg with the new files, then this would reduce the test data size from 29 MB to 0.5 MB.

As far as I can tell, there is no practical difference, as the coverage of panedr.py and pyedr.py is unchanged. The new files do only contain 4 frames (down from 14100), however, so I am not sure how true of a test of output verbosity this still poses.

@IAlibay
Copy link
Member

IAlibay commented Aug 2, 2022

then this would reduce the test data size from 29 MB to 0.5 MB.

That's reasonably small tbh, @jbarnoud would be the right judge of whether or not this is a suitable replacement for this test.

@jbarnoud
Copy link
Collaborator

jbarnoud commented Aug 2, 2022

I'm on my phone so it's a bit difficult to do better than work from memory. However, I think I remember that the point of the test file is to make sure we concatenate edr files the same way as gromacs. I don't see in the changes how it would have tested that, though 🤔

What I see, however is that the progress bar does not get tested as much as it was. Because it adapts to the number of frames, there should be a replacement test somehow to cover the feature.

@orbeckst
Copy link
Member

orbeckst commented Sep 1, 2022

Coverage also analyzed the test files. They should be excluded from coverage reporting.

@orbeckst
Copy link
Member

orbeckst commented Sep 1, 2022

What I see, however is that the progress bar does not get tested as much as it was. Because it adapts to the number of frames, there should be a replacement test somehow to cover the feature.

Would it be worthwhile replacing the progress output with tqdm instead? Then we don't have to worry about testing it.

@IAlibay IAlibay mentioned this pull request Sep 2, 2022
@BFedder
Copy link
Collaborator Author

BFedder commented Nov 4, 2022

I have tried changing pyedr now so that the progress bar is provided by tqdm instead. This also allowed me to remove the tests for the progress bar. However, I can't get codecov to work properly now... Please could someone help?

@IAlibay
Copy link
Member

IAlibay commented Nov 4, 2022

I can't get codecov to work properly now... Please could someone help?

Is this the upload failure or is there something else going wrong here?

@@ -1,3 +1,4 @@
pandas
pyedr
pbr
tqdm
Copy link
Member

Choose a reason for hiding this comment

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

Just FYI here - @BFedder and I had a chat about this a week or so ago and I told him to go ahead with this, tqdm is a reasonably small dependency, and it will make life a lot easier imho.

@jbarnoud as the original code author, do you have any issues with this?

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.

Couple of small things - could use a second opinion on removing timing @orbeckst @jbarnoud @hmacdope

panedr/setup.cfg Outdated Show resolved Hide resolved
panedr/requirements.txt Outdated Show resolved Hide resolved
pyedr/pyedr/pyedr.py Outdated Show resolved Hide resolved
Comment on lines 462 to 467
end = time.time()
if verbose:
print('\rLast Frame read : {}, time : {} ps'
.format(ifr, frame.t),
end='', file=sys.stderr)
print('\n{} frame read in {:.2f} seconds'.format(ifr, end - begin),
print('\n{} frames read in {:.2f} seconds'.format(ifr, end - begin),
Copy link
Member

Choose a reason for hiding this comment

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

Can we just get rid of timing altogether? You get iterations per second out of the standard tqdm output, otherwise if we really want total time, we could do something like bar_format="{l_bar}{bar}| {n_fmt}/{total_fmt} [{elapsed}]" or some variation of the tqdm barformat parameter?

Copy link
Member

Choose a reason for hiding this comment

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

I think there isn't really a need for timing as a default or even verbose option. IMO TQDM has enough timing info.

Copy link
Member

Choose a reason for hiding this comment

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

I guess you'll still need the verbose flag to turn tqdm on/off?

@@ -28,6 +28,7 @@ python_requires = >= 3.6
install_requires =
numpy
pbr
tqdm
Copy link
Member

Choose a reason for hiding this comment

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

Forgot to also say, can you add tqdm to the gh actions CI yaml file?

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.

lgtm - assuming @jbarnoud is fine with the changes here

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.

O actually forgot - @BFedder can you add an entry to the changelog? (you'll need to add a new version entry)

@BFedder
Copy link
Collaborator Author

BFedder commented Nov 6, 2022

Done!
Also deleted the old test data files now.

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.

thanks @BFedder

@hmacdope hmacdope merged commit 1f59799 into MDAnalysis:master Nov 6, 2022
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.

6 participants