pytuflow.GPKGRL.maximum

Contents

pytuflow.GPKGRL.maximum#

GPKGRL.maximum(locations, data_types, time_fmt='relative')#

Returns a DataFrame containing the maximum values for the given data types. The returned DataFrame will include time of maximum results as well.

It’s possible to pass in a well known shorthand for the data type e.g. q for flow.

The location can also be a filter string, e.g. line to extract the maximum values for all line geometries. The following filters are available for the GPKGRL class:

  • None: default - returns all available times

  • point:

  • line:

  • polygon: (or region)

The returned DataFrame will have an index column corresponding to the location IDs, and the columns will be in the format obj/data_type/[max|tmax], e.g. po/flow/max, po/flow/tmax

Parameters:
  • locations (str | list[str]) – The location to extract the maximum values for. None will return all locations for the given data_types.

  • data_types (str | list[str]) – The data types to extract the maximum values for. None will return all data types for the given locations.

  • time_fmt (str, optional) – The format for the time of max result. Options are relative or absolute

Returns:

The maximum, and time of maximum values

Return type:

pd.DataFrame

Examples

Extracting the maximum flow for a given location:

>>> res = GPKGRL('/path/to/plot_results_RL.gpkg')
>>> res.maximum('rl_line', 'flow')
          rl/flow/max       rl/flow/tmax
ds1            59.423           1.383333