Skip to content

Fixes Issue #2358#2359

Closed
richardjgowers wants to merge 2 commits intodevelopfrom
issue-2358-make_whole_small_box
Closed

Fixes Issue #2358#2359
richardjgowers wants to merge 2 commits intodevelopfrom
issue-2358-make_whole_small_box

Conversation

@richardjgowers
Copy link
Member

Fixes #2358

Changes made in this Pull Request:

PR Checklist

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

@codecov
Copy link

codecov bot commented Oct 1, 2019

Codecov Report

Merging #2359 into develop will decrease coverage by <.01%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #2359      +/-   ##
===========================================
- Coverage    89.98%   89.97%   -0.01%     
===========================================
  Files          176      176              
  Lines        22055    22045      -10     
  Branches      2896     2896              
===========================================
- Hits         19846    19836      -10     
  Misses        1612     1612              
  Partials       597      597
Impacted Files Coverage Δ
package/MDAnalysis/lib/_cutil.pyx 98.74% <ø> (-0.08%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4b82988...8075c3b. Read the comment docs.

Copy link
Member

@orbeckst orbeckst left a comment

Choose a reason for hiding this comment

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

Removing code is great.

Could you add a regression test?

.. versionchanged:: 0.20.0
Inplace-modification of atom positions is now optional, and positions
are returned as a numpy array.
.. versionchanged:: 0.20.2
Copy link
Member

Choose a reason for hiding this comment

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

should be 0.21.0

Copy link
Member

@zemanj zemanj left a comment

Choose a reason for hiding this comment

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

I still don't get the point here. You say that very small boxes can lead to no work being done. The shortcut identifies a molecule as already unwrapped if all distances are smaller than half a box edge length. In other words: the smaller the box, the less likely it should be that no work has to be done.

@zemanj

This comment has been minimized.

@orbeckst
Copy link
Member

@zemanj my review was clearly only scratching the surface whereas you have more in-depth insight. You should turn your last comment into an official review — you have a clear request there and you also clearly don’t want the change to happen until your concerns are addressed. The best way to express this is is a blocking review.

Thank you for having a look at the PR!

Copy link
Member

@zemanj zemanj left a comment

Choose a reason for hiding this comment

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

I don't understand why the shortcut causes make_whole() to return early if the box is small. I'd really appreciate it you could provide a minimal example reproducing the issue!

if not is_unwrapped:
break
if is_unwrapped:
return np.array(oldpos)
Copy link
Member

Choose a reason for hiding this comment

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

I added this shortcut in PR #2189 (see here) because it made make_whole() substantially faster (see my comment for timings).
I'd only throw that out if there really is no better way of fixing the small box problem.

@RMeli RMeli deleted the issue-2358-make_whole_small_box branch December 23, 2023 21:57
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.

make_whole exits early on small box

3 participants