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

amber TI parser (#10) #36

Merged
merged 8 commits into from
Nov 14, 2017
Merged

amber TI parser (#10) #36

merged 8 commits into from
Nov 14, 2017

Conversation

orbeckst
Copy link
Member

This PR supercedes PR #32: rebased and cleaned up history.

NOTE: This PR must be merged (not rebased, otherwise author information is lost)

- remove the main test function
- change to amber parser to be compatible with python 3
- clean up a print line
- change to .util
- test error handling for corrupted amber files
  alchemistry/alchemtest#11
- change the EOF detection/skip_after function for ziped file,
- fix some other minor issues
@orbeckst
Copy link
Member Author

I will look at this later in the afternoon. Hopefully the tests will still pass.

@orbeckst orbeckst requested a review from shuail November 13, 2017 20:05
@orbeckst
Copy link
Member Author

@shuail please review when you have time.

@codecov-io
Copy link

codecov-io commented Nov 13, 2017

Codecov Report

Merging #36 into master will increase coverage by 2.47%.
The diff coverage is 98.24%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #36      +/-   ##
==========================================
+ Coverage   95.12%   97.59%   +2.47%     
==========================================
  Files           8        9       +1     
  Lines         205      374     +169     
  Branches       28       59      +31     
==========================================
+ Hits          195      365     +170     
+ Misses          5        4       -1     
  Partials        5        5
Impacted Files Coverage Δ
src/alchemlyb/parsing/gmx.py 96.25% <ø> (+2.34%) ⬆️
src/alchemlyb/parsing/amber.py 98.24% <98.24%> (ø)
src/alchemlyb/parsing/util.py 100% <0%> (+11.11%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e018fdb...234edc0. Read the comment docs.

@shuail
Copy link
Collaborator

shuail commented Nov 13, 2017

@orbeckst thanks a lot! I have to run into a flight, will review this later today.

@dotsdl
Copy link
Member

dotsdl commented Nov 13, 2017

I pulled the amber tests for TI into the existing test module for less code duplication. The effect is identical as before. Thanks for all your work on this, @shuail and @orbeckst!

@davidlmobley
Copy link

Just spectating here. Nice job everyone -- great to see the process working. :)

@orbeckst
Copy link
Member Author

I am trying out pragma: no cover to get the 95% target. The justification is to be explicit about what you exclude from test coverage. I haven't done this that aggressively before but it seems a good idea, and with @dotsdl 's great initial coverage we can be very clear about which code paths are tested and which ones are not.

(Of course, the tests themselves still have to make sense but once you read the source and see that

                # FIXME: assumes fields are only integers or floats
                if '*' in value:            # Fortran format overflow
                    result.append(float('Inf') )

is not covered (and not excluded from coverage) then you get an idea where potential pain points are.)

orbeckst and others added 2 commits November 13, 2017 16:59
- use pytest paramterize for more fine grained control: each file
  is now run as as separate test, making it easier to spot and isolate
  specific problems
- added test that amber.extract_dHdl returns None for invalid files
  (NOTE: should this become an exception?)
- use #pragma: no cover to exclude lines from coverage
  (see https://www.mxsasha.eu/blog/2014/09/11/why-and-how-test-coverage-100/
  for a good justification: be explicit about what we decide to ignore)
  This allows us to get close to 100% coverage without hiding where
  we decide to ignore coverage.

See http://coverage.readthedocs.io/en/latest/excluding.html for how to use
`#pragma: no cover`.
@orbeckst
Copy link
Member Author

orbeckst commented Nov 14, 2017

I cleaned up the history and force-pushed, sorry for any inconvenience.

When you git pull you should see a forced update. If not, make sure that you have no changes, then git reset --hard master; git pull.

EDIT: Just to be clear: git reset --hard master will wipe out any changes in your branch. If you have uncommitted changes, create a new branch for them or use git stash.

@orbeckst
Copy link
Member Author

@dotsdl feel free to review but please don't merge until @shuail got a chance to review. I want to make sure that his code goes in properly.

@shuail if you and @dotsdl both approve you can merge the PR as is. (Do not rebase or squash because (1) this commit history has meaningful smaller commits and (2) rebasing is going to mess up the author attributions on any commit that has already gone through a rebase.) Thanks!

Excellent work!

Copy link
Collaborator

@shuail shuail left a comment

Choose a reason for hiding this comment

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

All looks good to me! Thanks @orbeckst for cleaning this up and merging all the commits here, I like this version better.

@orbeckst
Copy link
Member Author

Feel free to merge ("Merge pull request"). You can then delete this branch.

@dotsdl dotsdl merged commit 5173d17 into master Nov 14, 2017
@dotsdl dotsdl deleted the shuail-PR32 branch November 14, 2017 01:43
@orbeckst orbeckst mentioned this pull request Nov 14, 2017
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.

5 participants