[Review Needed]Pytest Style TestEncore #1609
Conversation
@kain88-de @jbarnoud @richardjgowers Review please. |
result_value = results[0, 1] | ||
min_bound = 1E5 | ||
self.assertGreater(result_value, min_bound, | ||
msg="Unexpected value for Harmonic Ensemble Similarity: {0:f}. Expected {1:f}.".format(result_value, min_bound)) | ||
assert result_value >= min_bound, "Unexpected value for Harmonic " \ |
kain88-de
Aug 13, 2017
Member
this is equivalent with self.assertGreaterEqual
and not a pure greater cheak
this is equivalent with self.assertGreaterEqual
and not a pure greater cheak
result_value = results[0,1] | ||
upper_bound = 0.6 | ||
self.assertLess(result_value, upper_bound, | ||
msg="Unexpected value for Dim. reduction Ensemble Similarity: {0:f}. Expected {1:f}.".format(result_value, upper_bound)) | ||
assert result_value <= upper_bound, "Unexpected value for Dim. " \ |
kain88-de
Aug 13, 2017
Member
this is not a self.assertLess
remove the equal sign.
this is not a self.assertLess
remove the equal sign.
np.copy(cls.ens2_template.trajectory.timeseries(format='fac')[::5, :, :]), | ||
assert average <= average_upper_bound, "Unexpected average value for " \ | ||
"bootstrapped samples in Dim. reduction Ensemble similarity" | ||
assert stdev <= stdev_upper_bound, "Unexpected standard deviation for" \ |
kain88-de
Aug 13, 2017
Member
see comment above for both asserts
see comment above for both asserts
distances += YY | ||
np.maximum(distances, 0, out=distances) | ||
distances.flat[::distances.shape[0] + 1] = 0.0 | ||
dimension = len(distances) |
kain88-de
Aug 13, 2017
Member
these should be in a fixture since arrays are not necessarily constant.
these should be in a fixture since arrays are not necessarily constant.
template = mda.Universe( | ||
template.filename, | ||
np.copy(template.trajectory.timeseries(format='fac')[::5, :, :]), | ||
format=mda.coordinates.memory.MemoryReader) |
kain88-de
Aug 17, 2017
Member
I think transfer_to_memory
has a step argument now that you can use instead of this trick.
I think transfer_to_memory
has a step argument now that you can use instead of this trick.
kain88-de
Aug 27, 2017
Member
Why do you still not use the step argument of transfer_to_memory
here?
Why do you still not use the step argument of transfer_to_memory
here?
distances += XX | ||
distances += YY | ||
np.maximum(distances, 0, out=distances) | ||
distances.flat[::distances.shape[0] + 1] = 0.0 |
kain88-de
Aug 17, 2017
Member
all this setup code should be in a fixture for distance_matrix. It's he only one that uses this. I also don't see the use for the fixture of dimensions
all this setup code should be in a fixture for distance_matrix. It's he only one that uses this. I also don't see the use for the fixture of dimensions
@kain88-de I've used |
template = mda.Universe( | ||
template.filename, | ||
np.copy(template.trajectory.timeseries(format='fac')[::5, :, :]), | ||
format=mda.coordinates.memory.MemoryReader) |
kain88-de
Aug 27, 2017
Member
Why do you still not use the step argument of transfer_to_memory
here?
Why do you still not use the step argument of transfer_to_memory
here?
template.transfer_to_memory(step=5) | ||
template = mda.Universe( | ||
template.filename, | ||
np.copy(template.trajectory.timeseries(format='fac')), |
kain88-de
Aug 27, 2017
Member
Do you know what this statement is doing? After using transfer to memory this shouldn't be necessary anymore.
Do you know what this statement is doing? After using transfer to memory this shouldn't be necessary anymore.
utkbansal
Sep 1, 2017
Author
Member
I don't think I have a real understanding of that statement.
I don't think I have a real understanding of that statement.
Fixes #
Changes made in this Pull Request:
PR Checklist