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

Added error for when no parameter fits #29734

Open
wants to merge 3 commits into
base: next
Choose a base branch
from

Conversation

DanielYankura
Copy link
Contributor

Reason

  • Can aid in debugging when developers are moving parameters around a lot

Design

  • added check to applyParameter that throws an error if the provided param does not match any known param
  • added to applyParameter unit test to ensure an error is thrown

Impact

New error check

closes #27556

@moosebuild
Copy link
Contributor

moosebuild commented Jan 23, 2025

Job Documentation, step Docs: sync website on 3d1467e wanted to post the following:

View the site here

This comment will be updated on new commits.

@loganharbour loganharbour self-assigned this Jan 23, 2025
Copy link
Member

@loganharbour loganharbour left a comment

Choose a reason for hiding this comment

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

I'm looking around to see if we can provide any more additional context to the error

@@ -16,6 +16,7 @@
#include "MultiMooseEnum.h"
#include "ExecFlagEnum.h"
#include "MooseObject.h"
#include "FEProblem.h"
Copy link
Member

Choose a reason for hiding this comment

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

What is this include needed for?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That is odd, I don't remember adding that? Doesn't seem like I need it though so I'll go ahead and remove it.

@moosebuild
Copy link
Contributor

moosebuild commented Jan 23, 2025

Job Coverage, step Generate coverage on 3d1467e wanted to post the following:

Framework coverage

951f23 #29734 3d1467
Total Total +/- New
Rate 85.25% 85.24% -0.00% 100.00%
Hits 108121 108121 - 2
Misses 18714 18716 +2 0

Diff coverage report

Full coverage report

Modules coverage

Coverage did not change

Full coverage reports

Reports

This comment will be updated on new commits.

@@ -1156,6 +1156,8 @@ InputParameters::applyParameter(const InputParameters & common,
// the parameter in the action
at(local_name)._hit_node = common.getHitNode(common_name);
}
else if (!local_exist && !common_exist)
mooseError("Attempted to apply invalid parameter \"", common_name, "\"");
Copy link
Member

Choose a reason for hiding this comment

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

Can we add just a little more context to this?

mooseError("InputParameters::applyParameter(): Attempted to apply invalid parameter \"", common_name, "\"");

- added check to applyParameter that throws an error if the provided param does not match any known param
- added to applyParameter unit test to ensure an error is thrown

closes idaholab#27556
@DanielYankura
Copy link
Contributor Author

I looked over the errored checks and I think they're unrelated to this PR.

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.

InputParameters applyParameter should error if no parameter fit
3 participants