saco.Dataset.set_optimise_flag

Dataset.set_optimise_flag(swabs_exclusions: Iterable[str] | None = ('reservoir', 'ldmu', 'lake'), purpose_exclusions: Iterable[str] = None, exclude_deregulated: bool = True, exclude_below: float | None = 0.1, exclude_below_case: tuple | None = ('FL', 95))

Set the (at least initial) value of the optimise flag columns in relevant tables.

The main role of this method is to provide defaults on what is included and excluded (i.e. available for change or not) during optimisation.

Parameters:
  • swabs_exclusions – Types of surface water abstractions to exclude (one or more of: ‘reservoir’, ‘ldmu’, ‘lake’. An empty list or None may also be provided.

  • purpose_exclusions – Purpose codes to exclude. Note that just the “start” of a purpose code can be supplied to act as a wildcard. For example, purpose_exclusions=[‘WPWS330’, ‘E’] would flag any rows with the specific purpose WPWS330 for exclusion from optimisation, as well as any purposes beginning E. No exclusions by default.

  • exclude_deregulated – Whether to exclude “deregulated licences” from optimisation - default is True, as not amenable to change in reality.

  • exclude_below – Threshold impact (Ml/d) below which (<=) abstractions should be excluded during optimisation. Use None or 0.0 to indicate that there should not be any exclusions based on impact magnitude. Based on scenario and percentile combination defined by exclude_below_case.

  • exclude_below_case – Scenario and percentile combination to use in conjunction with exclude_below threshold. By default, impacts less than or equal to exclude_below under the fully licensed scenario at Q95 will be flagged for exclusion from optimisation. Expects tuple like (‘FL’, 95).

Notes

This method operates on the data attributes of the SWABS_NBB, GWABs_NBB and SupResGW_NBB (complex) tables. If not already present, it inserts a flag column (called ‘Optimise_Flag’) that is used in the optimiser to include/exclude (1/0) particular table rows in the optimisation. By default, SWABS and GWABS rows are included (if not ruled out by one of the exlusion arguments), whereas complex impacts are excluded. If ‘Optimise_Flag’ columns are already present in the tables, this method will not modify them.

Options are available to:

  • Flag particular types of surface water abstractions for exclusion from optimisation (in line with the Fix-It tool).

  • Flag particular abstraction purposes for exclusion from optimisation.

  • Flag that deregulated licences should be excluded during optimisation.

  • Flag that impacts below some threshold should be excluded during optimisation.

Note that exclusions based on purpose are applied to both surface water and groundwater abstractions.

A user also has the option to (1) modify the Optimise_Flag columns created by this method or (2) set them manually. For complex impacts (in table SupResGW_NBB), manual intervention is necessary (by default these impacts are excluded from optimisation). See tutorial in documentation for complex flag details.