scenarios.AlternativeGroupCollection

Collection-like access to alternative groups.

Usage

Source

scenarios.AlternativeGroupCollection(scenario_manager)

Provides access to alternative groups in the MIKE+ model with dictionary-like syntax and helper methods for finding groups by related criteria.

Examples

>>> # Access by name/ID
>>> loads_group = db.alternative_groups["Loads and boundaries data"]
>>>
>>> # Get all group names
>>> group_names = db.alternative_groups.group_names()
>>> "Loads and boundaries data" in group_names
>>>
>>> # Find group by associated table
>>> msm_group = db.alternative_groups.by_table("msm_Link")

Methods

Name Description
__getitem__() Get alternative group by ID or name.
__init__() AlternativeGroupCollection constructor.
__iter__() Iterate through all alternative groups.
__repr__() Return a string representation of the AlternativeGroupCollection.
by_table() Find the alternative group associated with a specific table.
group_names() Get a list of available group names.

__getitem__()

Get alternative group by ID or name.

Usage

Source

__getitem__(key)
Raises
KeyError
If no alternative group with the specified ID or name is found

__init__()

AlternativeGroupCollection constructor.

Usage

Source

__init__(scenario_manager)
Parameters
scenario_manager: IScenarioManager
The underlying .NET scenario manager object

__iter__()

Iterate through all alternative groups.

Usage

Source

__iter__()

__repr__()

Return a string representation of the AlternativeGroupCollection.

Usage

Source

__repr__()

by_table()

Find the alternative group associated with a specific table.

Usage

Source

by_table(table_name)
Parameters
table_name: str
The name of the table to find the group for (e.g. “msm_Link”)
Returns
AlternativeGroup
The alternative group associated with the given table
Raises
KeyError
If no group is associated with the given table

group_names()

Get a list of available group names.

Usage

Source

group_names()