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
Fixing broken top reader #110
Fixing broken top reader #110
Conversation
- Re-enable test cases, - Exclusions-related bug, - Handling improper overrides in scaling code, - Atom naming to match conf.gro file in amber03w tests.
Does this PR replace #97 ? |
Negative, it just fixes the current |
Ok. I'll review when tests pass. Please ping me when ready. |
hmm, it's strange the base branch @orbeckst i'm no longer super-familiar with this code maybe you can shed some light on the failures? |
Maybe i'm doing sth wrong but on my end everything passes on
|
@orbeckst @dotsdl broken the travis.ci for develop branch just by restarting the build This is also described here It is some sort of numpy version problem |
@jandom do you still have issues with tmpdirs? Is there anything here you'd like from me? |
@dotsdl yeah i do – i'd like to understand how they can be used if a test fails? maybe i'm doing something inefficiently, but i suspect many other old-geezers do it the same :P I basically had to engineer the failed test case in a separate directory copying the input files into that location. I imagine that there is a way where I can go to the tmpdir used by the failed test and inspect what's going on there? |
Codecov Report
@@ Coverage Diff @@
## develop #110 +/- ##
==========================================
- Coverage 44.32% 44.1% -0.23%
==========================================
Files 26 26
Lines 4823 4834 +11
Branches 695 699 +4
==========================================
- Hits 2138 2132 -6
- Misses 2568 2583 +15
- Partials 117 119 +2
Continue to review full report at Codecov.
|
@jandom for your test to use a tmpdir at all, you need to explicitly use it in your test. Best way is to wrap the body of your test in a |
@dotsdl many thanks! all clear now :) 👍 |
@jandom are you ready for review? |
@orbeckst ready for review here |
@dotsdl please feel free to review, I don't have time today. |
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.
Just minor format things and comment clean up.
@@ -17,10 +17,10 @@ class TestAmber03star(TopologyTest): | |||
conf = datafile('fileformats/top/amber03star/conf.gro') | |||
molecules = ['Protein', 'SOL', 'IB+', 'CA', 'CL', 'NA', 'MG', 'K', 'RB', 'CS', 'LI', 'ZN'] | |||
|
|||
@pytest.mark.xfail(raises=ValueError, reason="Not currently maintained. See #61.") | |||
#@pytest.mark.xfail(raises=ValueError, reason="Not currently maintained. See #61.") |
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.
remove commented out xfail
def test_read_write(self, tmpdir): | ||
super(TestAmber03star, self).test_read_write(tmpdir) | ||
|
||
@pytest.mark.xfail(raises=GromacsError, reason="Not currently maintained. See #61.") | ||
#@pytest.mark.xfail(raises=GromacsError, reason="Not currently maintained. See #61.") |
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.
remove commented out xfail
gromacs/scaling.py
Outdated
for k in top.dict_molname_mol.keys(): | ||
if k in ["Protein", "SOL", "Ion" ]: continue | ||
del top.dict_molname_mol[k] | ||
#for k in top.dict_molname_mol.keys(): |
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.
Can this be removed or is there a good reason to keep the commented-out code around?
gromacs/scaling.py
Outdated
mol = scale_dihedrals(mol, dihedraltypes, args.scale_protein, banned_lines) | ||
mol = scale_impropers(mol, impropertypes, 1.0, banned_lines) | ||
for molname_mol in top.dict_molname_mol.keys(): | ||
if not 'Protein' in molname_mol: continue |
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 prefer putting continue
on a separate line (as well as having explicit for
blocks).
gromacs/scaling.py
Outdated
for at in mol.atoms: at.charge *= math.sqrt(args.scale_protein) | ||
mol = scale_dihedrals(mol, dihedraltypes, args.scale_protein, banned_lines) | ||
mol = scale_impropers(mol, impropertypes, 1.0, banned_lines) | ||
for molname_mol in top.dict_molname_mol.keys(): |
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.
YOu don't need .keys()
here. in
will do this automatically for a dict.
gromacs/scaling.py
Outdated
for molname_mol in top.dict_molname_mol.keys(): | ||
if not 'Protein' in molname_mol: continue | ||
mol = top.dict_molname_mol[molname_mol] | ||
for at in mol.atoms: at.charge *= math.sqrt(args.scale_protein) |
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.
block?
- break if..continue and for loop into separate blocks, - remove commented lines and annotations, - handle impropers and regular dihedrals in the same way.
@orbeckst this is now all resolved - thank you for all the comments |
Thanks a lot!! |
Fixes #61 @orbeckst