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

[Review Needed]Pytest Style analysis/test_waterdynamics.py #1571

Merged
merged 3 commits into from
Aug 1, 2017

Conversation

utkbansal
Copy link
Member

Fixes #

Changes made in this Pull Request:

PR Checklist

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

SELECTION2,
0, 5, 3)
hbl.run(verbose=False)
assert round(hbl.timeseries[2][1], 5) == 0.75
Copy link
Contributor

Choose a reason for hiding this comment

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

assert_almost_equal?

Copy link
Member Author

Choose a reason for hiding this comment

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

@jbarnoud I think it the exact equal works then we don't need to do almost equals!?

Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like the test tries to compare hbl.timeseries[2][1] to 0.75 but has precision issues. This is what assert_almost equal is for.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok.

sp_zero.run(verbose=False)
assert_equal(sp_zero.timeseries[1], 0.0)
SELECTION1 = "byres name OH2"
SELECTION2 = SELECTION1
Copy link
Contributor

Choose a reason for hiding this comment

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

I do not see a reason to have the SELECTION2 constant. SELECTION1 can be used instead just as well.

msd_zero = MDAnalysis.analysis.waterdynamics.MeanSquareDisplacement(
universe,
SELECTION2, 0, 10, 2)
msd_zero.run(verbose=False)
Copy link
Member

Choose a reason for hiding this comment

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

adding the verbose=False is not necessary. That already is the default.

@richardjgowers richardjgowers merged commit 081429a into MDAnalysis:develop Aug 1, 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.

None yet

4 participants