pytuflow.CrossSections

pytuflow.CrossSections#

class CrossSections(fpath)#

Bases: TabularOutput

Class for reading TUFLOW cross-section input layers.

This class does not need to be explicitly closed as it will load the results into memory and closes any open files after initialisation.

Only the attribute information is extracted from the cross-section GIS layer, therefore GDAL is not required to be installed to use this class as the supported formats (MIF, SHP, GPKG) all use common database formats to store the attribute information.

Parameters:

fpath (PathLike) – The path to the cross-section GIS Layer (i.e. 1d_xs layer).

Raises:

ResultTypeError – Raises pytuflow.results.ResultTypeError if the file does not look like a CrossSection file.

Examples

Load a cross-section layer:

>>> from pytuflow import CrossSections
>>> xs = CrossSections('path/to/1d_xs.shp')
__init__(fpath)#
Parameters:

fpath (Path | str)

Methods

curtain

Not supported for CrossSection results.

data_types

Returns the cross-section types within the filter from the cross-section layer.

ids

Returns the IDs within the filter from the cross-section layer.

profile

Not supported for CrossSection results.

section

Return the cross-section data for given location and cross-section type.

time_series

Not supported for CrossSection results.

times

CrossSections results are static and will not return any times.

Attributes

ATTRIBUTE_TYPES

DOMAIN_TYPES

GEOMETRY_TYPES

ID_COLUMNS

fpath

The path to the source output file.

cross_sections

List of loaded cross-sections.

objs

DataFrame of cross-sections information.

cross_section_count

Number of cross-sections

name

The result name

reference_time

The reference time for the output