tables.BaseTableCollection

A dict-like collection of tables in a model database.

Usage

Source

tables.BaseTableCollection(data_table_container)

This class provides a base implementation for table collections in a model database.

Methods

Name Description
__contains__() Check for a table using case-insensitive matching.
__getitem__() Get a table by name using case-insensitive matching.
__init__() Initialize a new BaseTableCollection.
__iter__() Get an iterator over table names.
__repr__() Get string representation.
items() Get all (name, table) pairs.
keys() Get all table names.
values() Get all table objects.

__contains__()

Check for a table using case-insensitive matching.

Usage

Source

__contains__(table_name)
Parameters
table_name: str
Table name in any casing.
Returns
bool
Whether a matching table exists.

__getitem__()

Get a table by name using case-insensitive matching.

Usage

Source

__getitem__(table_name)
Parameters
table_name: str
Table name in any casing.
Returns
BaseTable
The requested table.
Raises
KeyError
If no table matches table_name.
Notes

Collection keys retain their canonical MIKE+ casing.


__init__()

Initialize a new BaseTableCollection.

Usage

Source

__init__(data_table_container)
Parameters
data_table_container: DataTableContainer
The underlying data table container

__iter__()

Get an iterator over table names.

Usage

Source

__iter__()
Returns
Iterator over table names

__repr__()

Get string representation.

Usage

Source

__repr__()
Returns
str
The class name and number of tables.

items()

Get all (name, table) pairs.

Usage

Source

items()
Returns
ItemsView[str, BaseTable]
View of (name, table) pairs

keys()

Get all table names.

Usage

Source

keys()
Returns
KeysView[str]
View of the table names

values()

Get all table objects.

Usage

Source

values()
Returns
ValuesView[BaseTable]
View of the table objects