-
Notifications
You must be signed in to change notification settings - Fork 6
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
test core_fast added [Issue #28] #30
Conversation
@IAlibay, can I bother you to review this, pretty please? |
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.
As with all the other tests, could you please add an example on a much smaller system that humans can look at and understand? For example:
To check gridding:
- 25 lipids in 5x5 grid, with x values of 0, 1, 2, 3, 4 and y values of 0, 1, 2, 3, 4
- 25 lipids in 5x5 grid, with x values of 0.5, 1.5, 2.5, 3.5, 4.5 and y values of 0, 1, 2, 3, 4
-
- 25 lipids in 5x5 grid, with y values of 0.5, 1.5, 2.5, 3.5, 4.5 and x values of 0, 1, 2, 3, 4
- 25 lipids in 5x5 grid, with x values of 0.5, 1.5, 2.5, 3.5, 4.5 and y values of 0.5, 1.5, 2.5, 3.5, 4.5
- 25 lipids in 5x5 grid, with x values of -0.5, -1.5, 2.5, 3.5, 4.5 and y values of 0, 1, 2, 3, 4
- so on and so forth
- 50 lipids in 5x5 grid to check gridding of multiple lipids
- 50 lipids in 5x5 grid but all on one side of the box (like x > 2) to check gridding of uneven lipids
To check z-coord averaging
- z values of all 0
- z values of -1 and 1 (should average to 0 for the 50 lipid system, to check gridding)
- z values at the top of the box and bottom of the box (should average to 0, to check PBC)
Perhaps the other mentors @orbeckst @fiona-naughton @IAlibay have different perspectives, but IMO you will need to write these tests anyway for the new refactored code, and having them now will be an easy way to remember what does and doesn't work on your existing mdtraj code.
z_calc = np.zeros([n_cells, n_cells]) | ||
core_fast_leaflet(z_calc, "upper", mdtraj_po4, jump, n_cells, ["POPC"], md_ref_beads, max_width) | ||
core_fast(mdtraj_po4, jump, n_cells, ["upper"], ["POPC"], md_ref_beads, max_width, 'test') | ||
for z, z_test in zip(MEMBRANE_CURVATURE_DATA['z_avg_coords'], z_calc): |
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.
In unit testing we typically try to validate a single function in at least one test. Could you add tests where you check the functionality of core_fast
and core_fast_leaflet
separately in addition to this one?
Fixes issue #28
Changes
core_fast
function incore.py
.This PR helps to solve #17