tables.BaseTableCollection
A dict-like collection of tables in a model database.
Usage
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
__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
__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
__init__(data_table_container)Parameters
data_table_container: DataTableContainer- The underlying data table container
__iter__()
Get an iterator over table names.
Usage
__iter__()Returns
Iterator over table names
__repr__()
Get string representation.
Usage
__repr__()Returns
str- The class name and number of tables.
items()
Get all (name, table) pairs.
Usage
items()Returns
ItemsView[str, BaseTable]- View of (name, table) pairs
keys()
Get all table names.
Usage
keys()Returns
KeysView[str]- View of the table names
values()
Get all table objects.
Usage
values()Returns
ValuesView[BaseTable]- View of the table objects