Project

General

Profile

Feature #10820

Parameter validation based on limits

Added by Eric Flumerfelt almost 5 years ago. Updated about 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
11/05/2015
Due date:
% Done:

0%

Estimated time:
40.00 h
Duration:

Description

It would be really nice to specify a range of valid values for a parameter in the pset.get<>-style methods.
Example:

mytable: {
some_value: 2 # Should be between 0 and 10
}

aFunction(ParameterSet pset) {
int value = pset.get<int>("some_value",-1,0,10);
if(value == -1) { cout << "Invalid or missing value: \"some_value\"!!!" << endl;
}


Related issues

Blocked by fhicl-cpp - Feature #9079: Conditional configuration for fhiclcpp typesClosed06/09/2015

History

#1 Updated by Christopher Green almost 5 years ago

  • Blocked by Feature #9079: Conditional configuration for fhiclcpp types added

#2 Updated by Christopher Green almost 5 years ago

  • Status changed from New to Accepted
  • Estimated time set to 40.00 h

This can be done with the parameter set validation system, but requires the not-yet-implemented conditional validation feature described in issue #9079.

#3 Updated by Kyle Knoepfel about 4 years ago

  • Status changed from Accepted to Feedback

Is there still a desire for this feature, or can it be closed?

#4 Updated by Eric Flumerfelt about 4 years ago

I'm not sure. Issue #9079 may be sufficient for this, though in a DAQ environment, it's a good thing to have as many sanity checks on configuration parameters as possible. I think we can close this for now with the understanding that there may be a future issue that will be nearly identical to this one.

#5 Updated by Kyle Knoepfel about 4 years ago

  • Status changed from Feedback to Closed

I know there is a desire to validate a parameter based on a range or a set of allowed values, but that's in the context of ParameterSet validation, which uses a different system than what was envisaged in this request. So for the time being, I will close this issue per your guidance, but I will also open up a new nearly-identical feature request where the context is the configuration validation system.

Thanks for your feedback, Eric.



Also available in: Atom PDF