Skip to content
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

Reshape output of Observables #3560

Merged
merged 9 commits into from
Mar 3, 2020
Merged

Reshape output of Observables #3560

merged 9 commits into from
Mar 3, 2020

Conversation

jngrad
Copy link
Member

@jngrad jngrad commented Mar 3, 2020

Fixes #2233

Description of changes:

  • observables now return reshaped numpy arrays
  • observables return type is documented in the docstrings

@codecov
Copy link

codecov bot commented Mar 3, 2020

Codecov Report

Merging #3560 into python will increase coverage by <1%.
The diff coverage is 65%.

Impacted file tree graph

@@           Coverage Diff           @@
##           python   #3560    +/-   ##
=======================================
+ Coverage      87%     87%   +<1%     
=======================================
  Files         525     524     -1     
  Lines       23732   23603   -129     
=======================================
- Hits        20793   20769    -24     
+ Misses       2939    2834   -105
Impacted Files Coverage Δ
src/core/unit_tests/ParticleIterator_test.cpp 100% <ø> (ø) ⬆️
src/core/pressure.cpp 90% <ø> (ø) ⬆️
src/core/short_range_loop.hpp 100% <ø> (ø) ⬆️
src/core/forces_inline.hpp 85% <ø> (ø) ⬆️
src/core/event.cpp 94% <ø> (-1%) ⬇️
src/core/EspressoSystemInterface.cpp 90% <ø> (ø) ⬆️
src/core/cuda_init.cpp 0% <0%> (ø) ⬆️
src/core/collision.cpp 78% <100%> (-1%) ⬇️
src/core/ParticleIterator.hpp 100% <100%> (ø) ⬆️
src/core/cells.cpp 88% <100%> (ø) ⬆️
... and 19 more

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 dce27b3...1b281ca. Read the comment docs.

@jngrad jngrad added this to the Espresso 4.2 milestone Mar 3, 2020
@RudolfWeeber
Copy link
Contributor

RudolfWeeber commented Mar 3, 2020 via email

@jngrad
Copy link
Member Author

jngrad commented Mar 3, 2020

@RudolfWeeber This works, thanks! We discussed the naming convention internally and chose to use the underscore prefix because it allows users to add the underscore prefix in their old 4.1 scripts to get the old behavior back, without having to rework the numpy reshape logic (for example the LB stress tensor requires more than just a reshape operation). This info would only be mentioned in the release notes, and the _calculate method would then be removed in espresso 4.3 or 5.0 using some strategy (for example yours). Do you think we should use your solution right now for 4.2?

@RudolfWeeber
Copy link
Contributor

RudolfWeeber commented Mar 3, 2020 via email

@jngrad
Copy link
Member Author

jngrad commented Mar 3, 2020

and for lb stress, the format is confusing and error-prone. I'd change that toa a 3x3 matrix as well.

The LB stress tensor is now returned as a symmetric matrix instead of a flattened lower triangle.

I'd personally not do it, because people have to adapt their scripts anyway.

I'll remove the binding to the old method.

@jngrad jngrad added the automerge Merge with kodiak label Mar 3, 2020
@kodiakhq kodiakhq bot merged commit aa19013 into espressomd:python Mar 3, 2020
kodiakhq bot added a commit that referenced this pull request Mar 20, 2020
Description of changes:
- remove `min_dist2()`
- move logic from `dist_to()` into `system.distance_vec()`
- remove unused code
- fix a regression in `PidProfileObservable` introduced by #3560
- fix a regression in the OpenGL visualizer introduced by #3575
@jngrad jngrad deleted the fix-2233 branch January 18, 2022 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Proper return type for Observables needed
4 participants