-
Notifications
You must be signed in to change notification settings - Fork 188
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
testsuite: add test for is_valid_type. #3080
Conversation
Codecov Report
@@ Coverage Diff @@
## python #3080 +/- ##
======================================
- Coverage 83% 83% -1%
======================================
Files 530 530
Lines 26100 26083 -17
======================================
- Hits 21915 21899 -16
+ Misses 4185 4184 -1
Continue to review full report at Codecov.
|
|
why? |
Because you don't know if |
@@ -151,6 +151,8 @@ cdef class ParticleHandle: | |||
|
|||
def __set__(self, _pos): | |||
cdef double mypos[3] | |||
if np.isnan(pos).any() or np.isinf(pos).any(): |
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.
Why do you want to check that? I'm not sure that I follow. What scenario is this check for?
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.
it seems that the callbacks do not handle nan
. Please try:
import espressomd
system = espressomd.System(box_l=[10.0]*3)
system.part.add(pos=[float('nan')]*3)
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.
since pos
is the only particle property where the target node depends on the value of the property we should validate before calling the callback.
bors r=jngrad |
3080: testsuite: add test for is_valid_type. r=jngrad a=KaiSzuttor Currently it is possible to give ```nan``` as values to the particle properties because in python a ```nan``` is of type ```float```. This PR adds a check for ```None```, ```inf``` and ```nan``` to the ```is_valid_type``` and tests for the correct behavior. Co-authored-by: Kai Szuttor <[email protected]> Co-authored-by: Kai Szuttor <[email protected]>
bors r- |
Canceled |
bors r+ |
3070: Thermalized bond philox r=jngrad a=KonradBreitsprecher Fixes the TB part of #2683 - Common philox counter for all thermalized bonds. Decorrelation via the bond partner IDs (not taking into account the bond ID). This was much easier to implement and is valid, as two (different) thermalized bonds on the same particle pair makes no sense. 3080: testsuite: add test for is_valid_type. r=jngrad a=KaiSzuttor Currently it is possible to give ```nan``` as values to the particle properties because in python a ```nan``` is of type ```float```. This PR adds a check for ```None```, ```inf``` and ```nan``` to the ```is_valid_type``` and tests for the correct behavior. 3096: Core: Correct maximum permissible skin in tune_skin() r=jngrad a=RudolfWeeber Fixes #2924 Fix according to the discussion in #2924 Co-authored-by: KonradBreitsprecher <[email protected]> Co-authored-by: Konrad Breitsprecher <[email protected]> Co-authored-by: Konrad Breitsprecher <[email protected]> Co-authored-by: Jean-Noël Grad <[email protected]> Co-authored-by: Kai Szuttor <[email protected]> Co-authored-by: Kai Szuttor <[email protected]> Co-authored-by: Rudolf Weeber <[email protected]>
Build succeeded |
Currently it is possible to give
nan
as values to the particle properties because in python anan
is of typefloat
. This PR adds a check forNone
,inf
andnan
to theis_valid_type
and tests for the correct behavior.