Reformating & Sanity Checks of Adaptive Test-cases#52
Reformating & Sanity Checks of Adaptive Test-cases#52
Conversation
First version of reformatting; might be some errors.
- Introduces a far less repeatitive code - A test case, that verifies, that the integrator changes the time-step sizes, is added. - a test case, that verifies code changes still produce identical time‑step sizes in the output data, is added.
F-Ross
left a comment
There was a problem hiding this comment.
Overall looks good already, but some things still need to be adapted (pun intended).
| def after_iteration( | ||
| self, | ||
| iteration: int, | ||
| time_integration_state: TimeIntegrationState, | ||
| ode: DiscretizedODE, | ||
| discretization_scheme: TimeDiscretizationSchemeInterface, | ||
| ): | ||
| step_size = time_integration_state.step_size_history[0] | ||
| print(f"Step size: {step_size}") | ||
|
|
||
| # Save Step size in a file | ||
| with open(self.write_file, "a") as file: | ||
| file.write(f"{step_size}\n") |
There was a problem hiding this comment.
Is there any particular reason why you use a file and not e.g. a list or a set? Neither is the number of time steps expected to be so large that there could be a problem, you'd also have less problems fiddling with temporary paths later on. Furthermore, that gets you around the MPI-rank filter pattern.
There was a problem hiding this comment.
Your words of wisdom ring true, my fellowship. Still, I favor the company of files, for they lend themselves more readily to later reflection. If there is something wicked in this nature, it is but the consequence of the environment that shaped me.
`HowToGenerateNewData` Created: - A file explaining how to generated the data. changes in `TimeStepsLog`: - unnecessary lines removed `test_component_test_adaptive.py`: - Irrelevant comments removed - test cases parametarization are now called from fixtures.
`HowToGenerateNewData` Created: - A file explaining how to generated the data. changes in `TimeStepsLog`: - unnecessary lines removed `test_component_test_adaptive.py`: - Irrelevant comments removed - test cases parametarization are now called from fixtures.
`HowToGenerateNewData` Created: - A file explaining how to generated the data. changes in `TimeStepsLog`: - unnecessary lines removed `test_component_test_adaptive.py`: - Irrelevant comments removed - test cases parametarization are now called from fixtures.
time_step_log wrong attribute. should be log.
Reformatting and checks for Adaptive Test-Cases: