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

Fix TypeError in System.number_of_particles() #3536

Merged
merged 2 commits into from
Feb 23, 2020

Conversation

jngrad
Copy link
Member

@jngrad jngrad commented Feb 22, 2020

Fixes #3535

Description of changes:

  • fix an incorrect range check in System.number_of_particles()
  • cleanup Cython includes

Do a proper type check and remove the type validation / range
checking function. The logical OR caused non-integer values to be
checked against integer values. Global var max_seen_particle_type
is incorrect anyway (initialized with value 1) and cannot be used
for range checking. The core already does range checking anyway.
Remove includes of unused, un-implemented or non-existent functions.
@jngrad jngrad added this to the Espresso 4.1.3 milestone Feb 22, 2020
@jngrad jngrad requested a review from fweik February 22, 2020 17:14
@codecov
Copy link

codecov bot commented Feb 22, 2020

Codecov Report

Merging #3536 into python will decrease coverage by <1%.
The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff           @@
##           python   #3536   +/-   ##
======================================
- Coverage      87%     87%   -1%     
======================================
  Files         536     536           
  Lines       24177   24177           
======================================
- Hits        21059   21057    -2     
- Misses       3118    3120    +2
Impacted Files Coverage Δ
src/core/global.cpp 83% <0%> (ø) ⬆️
src/core/observables/ComVelocity.hpp 100% <0%> (ø) ⬆️
...rc/core/electrostatics_magnetostatics/scafacos.cpp 70% <0%> (ø) ⬆️
...re/bonded_interactions/bonded_interaction_data.cpp 91% <0%> (ø) ⬆️
...re/electrostatics_magnetostatics/dipole_inline.hpp 92% <0%> (ø) ⬆️
.../core/electrostatics_magnetostatics/p3m-common.cpp 90% <0%> (ø) ⬆️
src/core/grid_based_algorithms/lb.cpp 96% <0%> (ø) ⬆️
src/core/particle_data.cpp 95% <0%> (-1%) ⬇️
src/core/electrostatics_magnetostatics/dipole.cpp 63% <0%> (ø) ⬆️
...core/electrostatics_magnetostatics/p3m-dipolar.cpp 82% <0%> (ø) ⬆️
... 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 babd3de...43f8ec2. Read the comment docs.

@jngrad jngrad added the automerge Merge with kodiak label Feb 23, 2020
@kodiakhq kodiakhq bot merged commit dc4a9cc into espressomd:python Feb 23, 2020
@jngrad jngrad deleted the fix-3535 branch January 18, 2022 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TypeError in System.number_of_particles()
2 participants