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

Typing: timestepper fix pytest and cleanup integration routine #373

Merged
merged 12 commits into from
May 7, 2024

Conversation

skim0119
Copy link
Collaborator

@skim0119 skim0119 commented May 2, 2024

Type-hinting and cleanup timestepper routine

-> % mypy --config-file pyproject.toml elastica/timestepper
Success: no issues found in 5 source files
-> % make test
2181 passed, 1 skipped, 30 xfailed, 16 xpassed, 4 warnings in 16.18s

Modification on user-API

  • Integrator routine is simplified:
timestepper: SymplecticStepperProtocol = PositionVerlet()
dt = 1e-3
for _ in range(100):  # 100 timestepping
  timestepper.step(simulator, time=0.0, dt=dt)
  • Previous extend_stepper_interface and integrate should work same as before.
    • Added deprecation tag on extend_stepper_interface.
    • People should be able to just use integrate or custom stepping as above.

Minor changes

  • Updated and fixed any mypy type-hinting issues
  • 1_Timoshenko_Beam.ipynb is updated to use new time-step routine instead of extend_stepper_interface method.
  • timestepper.tag removed as we no-longer need to check type of the stepping method.
  • Fixed testing
  • autoflake8 -> autoflake : The forked repo autoflake8 is now deprecated, and autoflake is continued to be maintained.

@skim0119 skim0119 added the enhancement New feature or request label May 2, 2024
@skim0119 skim0119 self-assigned this May 2, 2024
@skim0119 skim0119 requested review from Ali-7800 and removed request for bhosale2 May 3, 2024 22:55
@skim0119 skim0119 mentioned this pull request May 3, 2024
17 tasks
Copy link
Contributor

@armantekinalp armantekinalp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have couple of questions. Please address them. Overall looks good. Thanks @skim0119

elastica/timestepper/symplectic_steppers.py Show resolved Hide resolved
elastica/timestepper/__init__.py Show resolved Hide resolved
elastica/timestepper/__init__.py Show resolved Hide resolved
Copy link
Contributor

@armantekinalp armantekinalp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@skim0119 skim0119 merged commit 98e9d0e into GazzolaLab:update/mypy May 7, 2024
2 of 6 checks passed
@skim0119 skim0119 deleted the typing/timestepper branch May 7, 2024 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants