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
Conversation
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
Fixes #
Changes made in this Pull Request:
PR Checklist