Skip to content

Support user-facing adaptivity in Python + doc improvements

Matt Wala requested to merge adaptive-dt into master

Closes #29

This adds a dt_next parameter to run and run_single_step to support adapting the time step. Additionally, the generator returned by run supports receiving the next value of dt via the send method.

In addition, this change:

  • Reduces code duplication between interpreter and codegen: the module dagrt.events_python is created to hold code for events
  • Renames StepCompleted.current_state to StepCompleted.current_phase
  • Improves the interpreter documentation
  • Adds a dt attribute to StepFailed
  • Makes a few stylistic fixes to the Python code generator
  • Addresses an interface inconsistency between the interpreter and the code generator: while the code generator raised a StepError in the case of a Raise, the interpreter raised whichever type was supplied by the Raise statement. This change modifies the behavior of Raise in the interpreter to also raise a StepError. The previous behavior required the argument to Raise to be a Python exception type, which went against the language-agnosticity of the representation.
  • Updates the adaptive_rk example to use the new adaptivity interface.

The version is bumped to 2019.5

Leap test (should not require any changes): leap!31

Edited by Matt Wala

Merge request reports

Loading