Skip to content

test(problem): add regression tests for Problem.simulate()#253

Open
g-braeunlich wants to merge 3 commits into
mainfrom
159-regression-tests
Open

test(problem): add regression tests for Problem.simulate()#253
g-braeunlich wants to merge 3 commits into
mainfrom
159-regression-tests

Conversation

@g-braeunlich

@g-braeunlich g-braeunlich commented May 28, 2026

Copy link
Copy Markdown
Collaborator

Description

Add regression tests for Problem.simulate() which check against reference values.

Fixes #159

Type of change

Please delete options that are not relevant.

  • Documentation only change (no code changed)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist:

  • I have run the pre-commit checks with pre-commit run --all-files
  • I have run ruff check . and ruff format
  • I have run mypy .
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Reviewer Checklist:

  • The content of this PR brings value to the community. It is not too specific to a particular use case.
  • The tests and checks pass (linting, formatting, type checking). For a new problem, double check the github actions workflow to ensure the problem is being tested.
  • The documentation is updated.
  • The code is understandable and commented. No large code blocks are left unexplained, no huge file. Can I read and understand the code easily?
  • There is no merge conflict.
  • The changes are not breaking the existing results (datasets, training curves, etc.). If they do, is there a good reason for it? And is the associated problem version bumped?
  • For a new problem, has the dataset been generated with our slurm script so we can re-generate it if needed? (This also ensures that the problem is running on the HPC.)
  • For bugfixes, it is a robust fix and not a hacky workaround.

@g-braeunlich g-braeunlich linked an issue May 28, 2026 that may be closed by this pull request
@g-braeunlich g-braeunlich force-pushed the 159-regression-tests branch 3 times, most recently from 57c04be to 16856a5 Compare May 28, 2026 14:50
@g-braeunlich g-braeunlich self-assigned this May 28, 2026
@g-braeunlich g-braeunlich force-pushed the 159-regression-tests branch 3 times, most recently from 043d6c5 to 12782cf Compare May 29, 2026 08:50
@g-braeunlich g-braeunlich requested a review from markfuge May 29, 2026 09:17
@g-braeunlich

Copy link
Copy Markdown
Collaborator Author

Also added 2 maintenance commits:

  • airfoil: numpy deprecated numpy.cross for 2D arrays
  • ci: migrate to latest ruff action (old one wont be compatible anymore in the future)

@g-braeunlich

Copy link
Copy Markdown
Collaborator Author

Other points to discuss:

  • Currently if no reference file is present, a warning is displayed to create a new file. Should that be an error instead?
  • The tolerance (currently: rtol=5e-5) could be made problem specific. Should we do that?

@markfuge markfuge left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Overall LGTM. We can discuss the open points you mentioned briefly at the next biweekly.

Background: numpy deprecated numpy.cross / numpy.linalg.cross for 2D vectors
@g-braeunlich g-braeunlich force-pushed the 159-regression-tests branch 4 times, most recently from ea7ded1 to a8560ed Compare June 12, 2026 09:47
@g-braeunlich g-braeunlich force-pushed the 159-regression-tests branch from a8560ed to 1dde049 Compare June 12, 2026 09:59
@g-braeunlich

Copy link
Copy Markdown
Collaborator Author

@markfuge I now have implemented things as discussed:
If a reference file is missing, an error is raised with a message explaining on how to create the file.
Reference files are json files and also have a rtol parameter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Regression tests

2 participants