-
Notifications
You must be signed in to change notification settings - Fork 51
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
Introduced the "extract" function to all the parsers, with relative tests #240
Introduced the "extract" function to all the parsers, with relative tests #240
Conversation
Codecov Report
@@ Coverage Diff @@
## master #240 +/- ##
==========================================
+ Coverage 98.44% 98.56% +0.11%
==========================================
Files 25 25
Lines 1673 1672 -1
Branches 357 353 -4
==========================================
+ Hits 1647 1648 +1
+ Misses 5 3 -2
Partials 21 21
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are great changes. This is an initial review. Do you mind bumping the coverage a bit? Thanks,
src/alchemlyb/parsing/amber.py
Outdated
@@ -252,63 +248,94 @@ def extract_u_nk(outfile, T): | |||
Temperature in Kelvin at which the simulations were performed; | |||
needed to generated the reduced potential (in units of kT) | |||
|
|||
Returns | |||
Returns a dictionary with elements: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't change this as this would break sphinx.
Just say return a dictionary. Might also be good to check if the doc builds correctly.
Returns
-------
Dict
A dictionary with keys of 'u_nk', which is a pandas DataFrame ....
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm sorry, I didn't know about that :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I edited the docstring for every new extract
functions, and added to the docs, now the extract
function appears correctly when the docs are built.
This is unfortunately impossible right now. I made a detailed check, the lines that are not covered by the tests are unaffected/not created by my modifications (so the coverage is the same as before, just the total number of lines is reduced as I removed an entire function in the amber parser). In the amber parser, I could easily reach a coverage of 99%, but the issues in alchemtest have to be addressed before, as I need 3 "properly" created files. Currently, in the amber parser, we have 4 lines that are not covered by the tests (and were not covered also before this PR), 3 of which are easily addressable with the 3 new files, while for the 4th I have to go deeper in understanding a function that was already there and that I don't currently understand 100% :-). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The current one looks reasonable to me. Just some comments.
This is unfortunately impossible right now. I made a detailed check, the lines that are not covered by the tests are unaffected/not created by my modifications (so the coverage is the same as before, just the total number of lines is reduced as I removed an entire function in the amber parser).
I do understand that some of the code are not being covered by the previous tests, do you mind adding # pragma: no cover
to bump the coverage?
|
@DrDomenicoMarson It would be best that all lines are covered. |
Have you checked that sphinx builds? As RTD is failing? |
I just re-checked, in my computer if I go inside alchemtest/docs and run |
Ok, digging deeper the problem was unrelated to this PR. |
Ok, it's a good thing this happened for us, as I fixed also a couple of other things in the docs regarding |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm happy with the content but we cannot merge it when the RTD fails.
Ok, probably give it a day or two and see if it got fixed by sphinx. |
Argh. Sigh. Thanks for raising #242 , that's the right approach! |
Regarding coverage: Are you saying that if we merged alchemistry/alchemtest#71 then you could increase the test coverage here and avoid no-cover pragmas? |
@orbeckst Yeah, I can cover all lines of parsers/amber.py except 1 line, but maybe it's better not in this PR, I'd prefer to merge this with the @xiki-tempula they fixed the bug in sphinx, so now all checks are passed here! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mind add the versionadded and this PR is ready to go.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM will merge if all tests passes.
@xiki-tempula what do you think about the |
@DrDomenicoMarson I think at the moment both of them are good. I mean it is either |
Ok, so we can just leave it like it's now, I remove the commented line in the test then, before the final merging! |
Ok, I hope not to have broken anything with this PR :-)
I added the
extract(file, T)
function to all the existing parsers, with a relative test for each parser.The only parser that was heavily hit by this PR is the AMBER parser, as was mentioned in issue #222 .
Here I had to make different adjustments, on my machine all tests are passing through.
I took the opportunity to make also some small, cosmetic, changes to the code in the amber parser (just a couple of them, like removing the unnecessary 'class SomeThing(Object').
PS: brace yourself, I now have a copy of Amber2022, and it seems the way dHdl/MBAR data is written has changed, so the parser will need an urgent update to handle AMBER <2022 | >=2022)