-
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
Collision detection maintenance #4484
Conversation
Rely on the C++ AutoParameters class to remove all the type conversion code from the Cython class. Convert the Cython file to a Python file. Use the standard checkpointing mechanism. Setting a protocol with invalid arguments no longer overwrites the global state; the old protocol is automatically restored.
Note: this PR is only meant to make the code more maintainable for the 4.2.0 release. It also lays the groundwork for a possible overhaul in a future minor release, e.g. 4.3.0 (#4483). |
ping |
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.
I guess you are right with #4483...
auto const param_name = get_value<std::string>(kv.first); | ||
if (expected_param_names.count(param_name) == 0) { | ||
// throw if parameter is unknown | ||
static_cast<void>(get_parameter(param_name)); |
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.
this is probably violating the SRP...
The uninitialized class member `bool exception_on_collision` could take any value and would randomly trigger a runtime warning or a fatal UBSAN report. The corresponding COLLISION_MODE_EXCEPTION feature was removed in the Tcl version of ESPResSo in 2017.
Description of changes:
collision_detection.pyx
to a Python fileAutoParameters
class instanceglue_to_surface
andbind_at_point_of_collision
requireVIRTUAL_SITES_RELATIVE
collision_detection.set_params()
with invalid arguments no longer leaves the system in an indeterminate state