PyElastica icon indicating copy to clipboard operation
PyElastica copied to clipboard

Use OperatorGroup for constrain and callback features

Open skim0119 opened this issue 1 year ago • 1 comments

resolve #401 resolve #402

Key update

  • Previously, only synchronize features used OperatorGroup. Now, both callback and constraint features use OperatorGroup to manage the operations.
  • Finalize methods is not converted since it is not specifically associated to a features (like FreeBC or OneEndFixedBC), but rather associated to a group (like Constraints or Forcing). Hence it does not require more complicated structure to manage the operation.

Minor update

  • partially resolve #402: explicit_steppers and related features are now moved to experimental folder.
    • This was because StepType was being refactored from rest of the OperatorType, and type-hinting for explicit stepper was causing more issues.
  • OperatorType now specifically means apply_forces, apply_torques, constrain_rates, etc.
    • OperatorType must take time as parameter inputs.
    • OperatorCallableType must take time and current_step as a parameter input.
  • StepType now specifically means callable functions used during the timestepping.
  • New test: condition to call callback at zero-step
  • Pytest-mock is added as part of dev-dependency for easier mock-testing.

skim0119 avatar Jun 29 '24 06:06 skim0119

Codecov Report

Attention: Patch coverage is 96.42857% with 2 lines in your changes missing coverage. Please review.

Project coverage is 94.35%. Comparing base (92d8b91) to head (c8535a8). Report is 1 commits behind head on update-0.3.3.

:exclamation: Current head c8535a8 differs from pull request most recent head 4f99538

Please upload reports for the commit 4f99538 to get more accurate results.

Files Patch % Lines
elastica/typing.py 71.42% 0 Missing and 2 partials :warning:
Additional details and impacted files
@@               Coverage Diff                @@
##           update-0.3.3     #404      +/-   ##
================================================
+ Coverage         93.96%   94.35%   +0.39%     
================================================
  Files                53       51       -2     
  Lines              3295     3187     -108     
  Branches            335      324      -11     
================================================
- Hits               3096     3007      -89     
+ Misses              152      134      -18     
+ Partials             47       46       -1     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Jul 01 '24 02:07 codecov[bot]