Allow "unsetting" non-critical keyword arguments to FlorisModel.set()
#974
Labels
enhancement
An improvement of an existing feature
FlorisModel.set()
#974
Provide ability to "unset" certain elements of the
FlorisModel
When keyword arguments are set on the instantiated
FlorisModel
using theset()
method, they are remembered. To override a previously set variable, one most override that variable with a new call toset()
. 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 passingNone
(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)
orfmodel.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 inUncertainFlorisModel
andParallelFlorisModel
).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
yaw_angles
,power_setpoints
,awc_modes
,awc_amplitudes
,awc_frequencies
,disable_turbines
)wind_data
,turbine_type
andturbine_library_path
,solver_settings
The text was updated successfully, but these errors were encountered: