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

Make control naming consistent #9816

Open
verveerpj opened this issue Jan 21, 2025 · 1 comment
Open

Make control naming consistent #9816

verveerpj opened this issue Jan 21, 2025 · 1 comment

Comments

@verveerpj
Copy link
Contributor

verveerpj commented Jan 21, 2025

Is your feature request related to a problem? Please describe.
The variables that are optimized (controls in Everest nomenclature) are specified in a nested fashion: We have controls, which defines groups of variables, which in turn can have multiple components labeled with an integer index. For example (from config_advanced.yml):

controls:
  - name: point
    max: 1.0
    min: -1.0
    initial_guess: 0.25
    perturbation_magnitude: 0.005
    type: generic_control
    variables:
      - name: x
        index: 0
      - name: x
        index: 1
      - name: x
        index: 2

This defines three controls, with the following control, variable, and index fields:

  • point, x, 0
  • point, x, 1
  • point, x, 2

When reporting results, control names are constructed from the three fields as follows control_variable-index, so we get:

  • point_x-0
  • point_x-1
  • point_x-2

When specifying input constraints, weights need to be set for a sub-set of controls, so controls are needed, but in this case they follow the form control.variable-index. For instance (from config_advanced.yml):

input_constraints:
  - weights:
      point.x-0: 0
      point.x-1: 0
      point.x-2: 1
    upper_bound: 0.4

This is inconsistent and potentially confusing for the user.

Describe the solution you'd like
When a string representation of controls is shown, or required as an input, it should always have the same form. There should be a singe function/method responsible for formatting the string from control, variable, index fields. Preferably this transformation should be invertible, although we should not rely on that in code. If possible, the delimiters used should not be allowed in control and variable names. We should discuss the delimiters to use, but using . and - would be backwards compatible for specifying input constraints and it would leave the underscore available for control and variable naming.

@yngve-sk
Copy link
Contributor

yngve-sk commented Jan 31, 2025

Do we need to have 2 delimiters for this? Why couldn't we just do point.x.0 for example?

@yngve-sk yngve-sk moved this from Todo to In Progress in SCOUT Jan 31, 2025
@yngve-sk yngve-sk self-assigned this Jan 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: In Progress
Development

No branches or pull requests

2 participants