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

#680: Remove/simplify constants #685

Merged
merged 4 commits into from
Sep 26, 2024
Merged

Conversation

cwschilly
Copy link
Collaborator

@cwschilly cwschilly commented Sep 23, 2024

Fixes #680

This PR moves the Constants struct into ode_constants.hpp, so we can still use the fractions (e.g. fourOvThree) easily.

  • This means that the code in ode is largely unchanged, besides simplifications and replacing utils::Constants with ode::constants::Constants (often with using cnst = ::pressio::ode::constants::Constants<scalar_t>).

  • All code outside of ode replaces any calls to utils::Constants with static_cast.

@cwschilly cwschilly linked an issue Sep 23, 2024 that may be closed by this pull request
@cwschilly cwschilly requested a review from fnrizzi September 23, 2024 18:26
@fnrizzi
Copy link
Member

fnrizzi commented Sep 24, 2024

@cwschilly before i merge it, can you please try to "randomly" pick some places and inject the wrong value (eg.. wheere there is a 1 put 2 or similar) and run the tests to see if these errors are detected? just curious if the test suite is strong enough

@cwschilly
Copy link
Collaborator Author

@cwschilly before i merge it, can you please try to "randomly" pick some places and inject the wrong value (eg.. wheere there is a 1 put 2 or similar) and run the tests to see if these errors are detected? just curious if the test suite is strong enough

@fnrizzi You can see the test failures here.

The failures are in ode and rom testing, although my changes were in ode and solvers_nonlinear. That suggests that we might need better coverage at least in solvers_nonlinear.

@fnrizzi
Copy link
Member

fnrizzi commented Sep 25, 2024

Can you please write/report here in a comment what you changed and what the error was

@fnrizzi
Copy link
Member

fnrizzi commented Sep 26, 2024

@cwschilly before i merge it, can you please try to "randomly" pick some places and inject the wrong value (eg.. wheere there is a 1 put 2 or similar) and run the tests to see if these errors are detected? just curious if the test suite is strong enough

@fnrizzi You can see the test failures here.

The failures are in ode and rom testing, although my changes were in ode and solvers_nonlinear. That suggests that we might need better coverage at least in solvers_nonlinear.

it is good ode and rom fail.
I expect solvers not to fail miserably because what you changed is a coefficient for the levenberg-marquardt parameter, so by changing that we are just perturbing the system a bit but it can recover since it is an iterative method.
but i guess to your point, yes we could do a more controlled test.

@fnrizzi fnrizzi merged commit 825d617 into develop Sep 26, 2024
24 checks passed
@fnrizzi fnrizzi deleted the 680-removesimplify-constants branch October 14, 2024 13:13
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.

remove/simplify constants
2 participants