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

Pytest Style analysis/test_psa.py #1569

Merged
merged 3 commits into from Jul 30, 2017
Merged

Conversation

utkbansal
Copy link
Member

Fixes #

Changes made in this Pull Request:

PR Checklist

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

@utkbansal utkbansal changed the title [Review needed]Pytest Style analysis/test_psa.py Pytest Style analysis/test_psa.py Jul 30, 2017
err_msg = "Dendrogram dictionary object was not produced"
assert_(type(self.plot_data[1]) is dict, err_msg)
assert type(plot_data[1]) is dict, err_msg
Copy link
Contributor

Choose a reason for hiding this comment

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

isinstance is probably more appropriate than type(...) is ....

self.path_2)
self.expected = (np.mean(np.amin(self.distance_matrix, axis=0)) +
np.mean(np.amin(self.distance_matrix, axis = 1))) / 2.
# TODO: Fix this hack! without the fixture the test says I passed 3
Copy link
Contributor

Choose a reason for hiding this comment

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

Could h be a class attribute rather than a fixture?

Copy link
Member Author

Choose a reason for hiding this comment

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

I did try that, but when I make it a class attribute, the test fails saying that h expected 2 parameters but got 3.

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 indeed like h, when defined as a class attribute, is taken as a method. I guess you could define it as h = staticmethod(PSA.hausdorff_wavg) but I am not sure it is much better than the fixture. Maybe somebody will come with an idea. If not, we'll survive with the fixture.

@jbarnoud jbarnoud added this to the 0.17.0 milestone Jul 30, 2017
@jbarnoud jbarnoud self-assigned this Jul 30, 2017
@jbarnoud jbarnoud merged commit a4e5791 into MDAnalysis:develop Jul 30, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants