pytuflow.GPKG1D.ids#
- GPKG1D.ids(filter_by=None)#
Returns all the available IDs for the given filter.
The
filter_by
argument can be used to add a filter to the returned IDs. Available filters for theGPKG1D
class are:None
: default - returns alltimeseries
IDs1d
: same asNone
as class only contains 1D datanode
channel
timeseries
: returns only IDs that have time series data.section
: returns only IDs that have section data (i.e. long plot data).[data_type]
: returns only IDs for the given data type. Shorthand data type names can be used.
- Parameters:
filter_by (str, optional) – The string to filter the IDs by.
- Returns:
The available IDs.
- Return type:
list[str]
Examples
The below examples demonstrate how to use the
filter_by
argument to filter the returned IDs. The first example returns all IDs:>>> res = GPKG1D('path/to/output_swmm_ts.gpkg') >>> res.ids() ['FC01.1_R', 'FC01.2_R', 'FC04.1_C', 'FC01.1_R.1', 'FC01.1_R.2', 'FC01.2_R.1', 'FC01.2_R.2', 'FC04.1_C.1', 'FC04.1_C.2']
Return only node IDs:
>>> res.ids('node') ['FC01.1_R.1', 'FC01.1_R.2', 'FC01.2_R.1', 'FC01.2_R.2', 'FC04.1_C.1', 'FC04.1_C.2']
Return IDs that have water level results:
>>> res.ids('h') ['FC01.1_R.1', 'FC01.1_R.2', 'FC01.2_R.1', 'FC01.2_R.2', 'FC04.1_C.1', 'FC04.1_C.2']