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

Refactor reaction method constraints #4310

Merged
merged 3 commits into from
Jul 22, 2021

Conversation

jngrad
Copy link
Member

@jngrad jngrad commented Jul 22, 2021

Description of changes:

  • unit test reaction constraints
  • make reaction constraint fields private
  • make invalid constraint parameters raise a ValueError
  • make it safe to change a reaction constraint from cylindrical to slab
  • make it possible to remove a reaction constraint

jngrad added 3 commits July 22, 2021 12:52
Provide setters and getters to control the reaction constraints.
Provide a mechanism to reset the constraint to the full box.
@jngrad jngrad added this to the Espresso 4.2 milestone Jul 22, 2021
@jngrad jngrad requested a review from reinaual July 22, 2021 11:56
@jngrad
Copy link
Member Author

jngrad commented Jul 22, 2021

@reinaual This isn't a perfect solution, but there is no need to spend more time on this part of the code for now. The long-term plan is to extract the reaction constraint logic from the ReactionAlgorithm class to improve extensibility and separation of concerns. Shouldn't be too hard now that the logic is fully private. An enum was the quickest way to make the code safely unit testable.

@jngrad jngrad added the automerge Merge with kodiak label Jul 22, 2021
@kodiakhq kodiakhq bot merged commit d2820a7 into espressomd:python Jul 22, 2021
@jngrad jngrad deleted the reaction_algorithm_constraints branch July 22, 2021 15:39
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.

2 participants