-
Notifications
You must be signed in to change notification settings - Fork 189
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
Refactor Analysis module: distance functions #3586
Conversation
Reduce code complexity by storing Vector3d objects directly.
The function was unused, untested, and the documentation was wrong (it returned the squared distance). The same result can be obtained with `system.distance(system.part[i], system.part[j])**2`.
Check out this pull request on You'll be able to see Jupyter notebook diff and discuss changes. Powered by ReviewNB. |
@RudolfWeeber I'm splitting the work in multiple PRs. I'm converting the analysis functions |
Codecov Report
@@ Coverage Diff @@
## python #3586 +/- ##
=======================================
+ Coverage 88% 88% +<1%
=======================================
Files 528 528
Lines 23607 23590 -17
=======================================
- Hits 20785 20777 -8
+ Misses 2822 2813 -9
Continue to review full report at Codecov.
|
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.
Maybe we can get rid of distto
Concerning the histogram observables: this is probably a bit more involved because currently it also has the issue that histogram information cannot be retrieved. Also it may be worth to first refactor the observable framework and afterwards think about interaction with the histograms? |
I haven't looked into histograms, not sure how much of if it will overlap with my work on the |
```
@jngrad commented on this pull request.
_____
In src/python/espressomd/system.pyx <#3586 (comment)> :
> @@ -359,6 +360,63 @@ cdef class System:
return make_array_locked(mi_vec)
+ def dist_to(self, id=None, pos=None):
would you like me to change the system.distance_vec() to take either particles or 3d vectors, so that we can use your one-liner?
Yes. There should be only system.distance and system.distance_vec. Both should take either a 3-array or a ParticleHandle as either of their arguments.
```
|
Description of changes:
min_dist2()
dist_to()
intosystem.distance_vec()
PidProfileObservable
introduced by Reshape output of Observables #3560