pytuflow.LP2D.ids

Contents

pytuflow.LP2D.ids#

LP2D.ids(filter_by=None)#

Returns all the available IDs for the given filter.

The chainages along the 2d_lp line will each be given a unique ID based on the name of the 2d_lp line. If a GIS file is provided, the label will be extracted from the “label” field. If no GIS file is provided, the line label cannot be determined, so the file name excluding the data type is used.

Point IDs will be made up as [label]_[offset]_pnt[index].

The filter_by argument can be used to add a filter to the returned IDs. Available filters objects for the LP2D class are:

  • None: default - returns all IDs

  • 2d: same as None as class only contains 2D data

  • node / point: returns only point IDs

  • nodestring / line: returns only line IDs

  • timeseries: returns only IDs that have time series data (same as point for the LP2D class).

  • section: returns only IDs that have section data (i.e. long plot data - same as line for the LP2D class).

  • [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

>>> lp = LP2D('/path/to/model_LP_NAME_H.csv')
>>> lp.ids()
['EG02_012_LP_01_2.07_pnt0', 'EG02_012_LP_01_8.31_pnt1', 'EG02_012_LP_01_14.55_pnt2', ..., 'EG02_012_LP_01']