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

Align the type of inputs passed from cost to problem and model #358

Closed
NicolaCourtier opened this issue Jun 12, 2024 · 3 comments · Fixed by #359
Closed

Align the type of inputs passed from cost to problem and model #358

NicolaCourtier opened this issue Jun 12, 2024 · 3 comments · Fixed by #359
Assignees
Labels
enhancement New feature or request

Comments

@NicolaCourtier
Copy link
Member

Feature description

Align the evaluate and simulate functions of a problem/observer and model to accept only inputs of type Inputs. Update the Parameters functionality to return dictionaries rather than arrays.

Motivation

To continue improvements enabled by the addition of the Parameters class in #322 and work towards enabling optimisation of mulitple costs/problems/models with different or overlapping parameter sets.

Possible implementation

No response

Additional context

No response

@NicolaCourtier NicolaCourtier added the enhancement New feature or request label Jun 12, 2024
@NicolaCourtier NicolaCourtier self-assigned this Jun 12, 2024
This was referenced Jun 12, 2024
@BradyPlanden
Copy link
Member

BradyPlanden commented Jun 13, 2024

Hi @NicolaCourtier, thanks for raising this. I'm keen to add the option to pass the Inputs type to the cost/problem/model, however is there a technical reason that this has to be the only type with the upcoming batch study changes?

In our current form, I very much like being able to do this: cost([0.5,0.5]) as it's a very quick way to check the constructed objects, and interact cost/problem/model. I would like to keep the type interoperability for list and np.array if possible.

@NicolaCourtier
Copy link
Member Author

Hey @BradyPlanden, in the PR #352, I have kept the ability to pass values like this to the call, evaluate and evaluateS1 functions of the cost (as the optimiser does).

Further down the chain (from cost to problem to model), I think we need to keep the parameter names associated with the values in order to prevent against cases where values are passed to the incorrect parameter. Having said this, I have also kept the ability to pass values directly to quick_plot. The quick way to pass values to a problem or model would be parameters.as_dict(x). Please describe any other functionality you would like to see.

@BradyPlanden
Copy link
Member

Excellent, thanks for clarifying. That makes sense to me.

@NicolaCourtier NicolaCourtier moved this to In Progress in v24.9 Jun 18, 2024
@NicolaCourtier NicolaCourtier removed this from v24.9 Jul 4, 2024
@NicolaCourtier NicolaCourtier moved this to In Progress in v24.6 Jul 4, 2024
@github-project-automation github-project-automation bot moved this from In Progress to Done in v24.6 Jul 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants