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

Projects
None yet
4 participants
@utkbansal
Member

utkbansal commented Jul 30, 2017

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

This comment has been minimized.

@jbarnoud

jbarnoud Jul 30, 2017

Contributor

assert_almost_equal?

This comment has been minimized.

@utkbansal

utkbansal Jul 30, 2017

Member

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

This comment has been minimized.

@jbarnoud

jbarnoud Jul 30, 2017

Contributor

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.

This comment has been minimized.

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

This comment has been minimized.

@jbarnoud

jbarnoud Jul 30, 2017

Contributor

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)

This comment has been minimized.

@kain88-de

kain88-de Jul 30, 2017

Member

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

@richardjgowers richardjgowers merged commit 081429a into MDAnalysis:develop Aug 1, 2017

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage decreased (-0.01%) to 90.406%
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment