Skip to content

Allow "unsetting" non-critical keyword arguments to FlorisModel.set() #974

@misi9170

Description

@misi9170

Provide ability to "unset" certain elements of the FlorisModel

When keyword arguments are set on the instantiated FlorisModel using the set() method, they are remembered. To override a previously set variable, one most override that variable with a new call to set(). However, for some arguments, in particular, heterogeneous_inflow_config, it would be nice to be able to "unset" or forget a previous setting. FlorisModel currently has no way to do this, since passing None (e.g. fmodel.set(heterogeneous_inflow_config=None)) simply means using the previously set case.

Proposed solution

A possible solution would be to allow a special (unambiguous) argument to be passed to keywords that could be "unset" in order to trigger the unsetting action. For example, fmodel.set(heterogeneous_inflow_config=-1) or fmodel.set(heterogeneous_inflow_config=False).

Alternatives considered

A second alternative is to define new methods on FlorisModel for the unsetting procedure. This is actually something that we already have for unsetting previously set control actions: FlorisModel.reset_operation(). However, if we go down this route, we'll need a new method for each non-critical variable, which seems a little annoying (especially if these changes are to be reflected in UncertainFlorisModel and ParallelFlorisModel).

Current workaround

For now, users can "forget" things by simply reinstantiating their FlorisModel from scratch.

Additional context

I'd like a general solution here, which requires identifying which of the arguments to FlorisModel.set() are valid candidates for "unsetting". I would think at least the following:

  • heterogeneous_inflow_config
  • Control setpoints (yaw_angles, power_setpoints, awc_modes, awc_amplitudes, awc_frequencies, disable_turbines)
  • possibly wind_data, turbine_type and turbine_library_path, solver_settings

Metadata

Metadata

Assignees

Labels

enhancementAn improvement of an existing featureideas-listIdeas that would be nice to do but aren't scheduled. Lower priority than back-log.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions