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

[WIP]Pytest Style analysis/test_align.py #1546

Merged
merged 4 commits into from Aug 3, 2017

Conversation

utkbansal
Copy link
Member

Fixes #

Changes made in this Pull Request:

PR Checklist

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

@kain88-de
Copy link
Member

build fails

@kain88-de
Copy link
Member

build still fails

@utkbansal
Copy link
Member Author

@kain88-de Build passed without changing anything.

assert_equal(rot, np.eye(3))
assert_equal(rmsd, None)
assert rmsd is None
Copy link
Member

Choose a reason for hiding this comment

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

I have a feeling the first 3 tests can be parametrized.

Copy link
Member Author

Choose a reason for hiding this comment

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

What do I name it?

Copy link
Member

Choose a reason for hiding this comment

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

test_rotation_matrix_input?

Copy link
Member Author

Choose a reason for hiding this comment

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

done.

err_msg="RMSD calculation between 1st and last "
"AdK frame gave wrong answer")
assert_almost_equal(rms.rmsd(last_frame, first_frame, superposition=True), rmsd, 6, err_msg="error: rmsd() is not symmetric")
assert_almost_equal(rmsd, 6.820321761927005, 5, err_msg="RMSD calculation between 1st and last AdK frame gave wrong answer")
Copy link
Member

Choose a reason for hiding this comment

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

please avoid these super long lines. The pep8 standard is 80 chars

def test_rmsd_deprecated(self, universe, reference):
last_atoms_weight = universe.atoms.masses
A = universe.trajectory[0]
B = reference.trajectory[-1]
with warnings.catch_warnings(record=True) as warn:
Copy link
Member

Choose a reason for hiding this comment

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

can use the warnings catcher from pytest pytest.warns

(a, b, w),
(a.astype(np.int), b.astype(np.int), w.astype(np.float32))
))
def test_rotation_matrix_input(self, a, b, weights): # TODO: Fix the name
Copy link
Member

Choose a reason for hiding this comment

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

you left the fixme

@kain88-de kain88-de merged commit 858069f into MDAnalysis:develop Aug 3, 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

3 participants