pytuflow.CrossSectionDatabase

pytuflow.CrossSectionDatabase#

class CrossSectionDatabase(fpath=None, config=None, parent=None, scope=None, driver=None)#

Bases: FMDatabaseMixin, DatabaseBuildState

Database class for storing cross-sections.

Currently, the Database class has not implemented the write() method, so it should be initialised with a fpath to an existing database file as it can’t be edited.

Parameters:
  • fpath (str | Path | None)

  • config (TCFConfig)

  • parent (ControlFile)

  • scope (ScopeList)

  • driver (type[DatabaseDriver])

__init__(fpath=None, config=None, parent=None, scope=None, driver=None)#
Parameters:
  • fpath (str | Path | None)

  • config (TCFConfig)

  • parent (ControlFile)

  • scope (ScopeList)

  • driver (type[DatabaseDriver])

Methods

context

Create a RunState version of this object.

entry_class

no-doc

items

Returns an iterator over the (key, value) pairs in the database.

record_change

undo

value

Returns the value of the given item from the database.

write

Write the object to file.

Attributes

INDEX_COL

SOURCE_INDEX

TIME_INDEX

TUFLOW_TYPE

A string identifying the PyTUFLOW object type.

VALUE_INDEX

df

dirty

Whether the object has been changed since it was last written to file.

driver

fpath

scope

List of scopes associated with the object.

tcf

parent

Parent control that this database belongs to.

config

Configuration object for the TUFLOW control file.

altered_inputs

a list of all changes made to the control file since the last write

loaded

whether the database has been loaded from disk or not.

entries

Ordered dictionary containing the database entries.