OutputCaseContainerSetup

Qualified name: api.simulation.output_cases.output_case_container_setup.OutputCaseContainerSetup

class api.simulation.output_cases.output_case_container_setup.OutputCaseContainerSetup(item)[source]

Bases: ABC

Methods

create_output_case_setup

Creates a output case and returns a corresponding OutputCaseSetupPipeline object

get_available_output_case_names

Gets the names of existing output cases, with the ordering being the same as the order in the underlying list at the moment of calling this method

get_name

Returns the name of the object

get_output_case_setup

Returns a OutputCaseSetupPipeline object for a output case setup object with the given name

remove_output_case_setup

Removes a output case

set_name

Sets the name of the output case container

abstractmethod create_output_case_setup(oc_type) OutputCaseSetupPipeline[source]

Creates a output case and returns a corresponding OutputCaseSetupPipeline object

Example

>>> from more.api import ApiGateway
>>> api = ApiGateway(proj=proj)
>>> simulation_setup = api.create_simulation_setup()
>>> output_case_container_setup = simulation_setup.create_output_case_container_setup()
>>> output_case_setup = output_case_container_setup.create_output_case_setup(oc_type='Mechanical output case')
Returns:

A OutputCaseSetupPipeline object for the created output case

Return type:

OutputCaseSetupPipeline

Raises:

NameNotFoundError – Raised if no outputd case type with the given name was found

abstractmethod get_available_output_case_names() List[str][source]

Gets the names of existing output cases, with the ordering being the same as the order in the underlying list at the moment of calling this method

Example

>>> from more.api import ApiGateway
>>> api = ApiGateway(proj=proj)
>>> simulation_setup = api.create_simulation_setup()
>>> output_case_container_setup = simulation_setup.create_output_case_container_setup()
>>> _ = output_case_container_setup.create_output_case_setup(oc_type='Mechanical output case')
>>> _ = output_case_container_setup.create_output_case_setup(oc_type='Mechanical output case')
>>> _ = output_case_container_setup.create_output_case_setup(oc_type='Mechanical output case')
>>> output_case_container_setup.get_available_output_case_names()
['Mechanical output case', 'Mechanical output case 1', 'Mechanical output case 2']
Returns:

Names of available output cases

Return type:

list of strings

abstractmethod get_name() str[source]

Returns the name of the object

Example

>>> from more.api import ApiGateway
>>> api = ApiGateway(proj=proj)
>>> simulation_setup = api.create_simulation_setup()
>>> output_case_container_setup = simulation_setup.create_output_case_container_setup()
>>> output_case_container_setup.set_name(name='new_name')
<more...>
>>> output_case_container_setup.get_name()
'new_name'
Returns:

name – The name of the object

Return type:

str

abstractmethod get_output_case_setup(oc_type: str | None = None, name: str | None = None)[source]

Returns a OutputCaseSetupPipeline object for a output case setup object with the given name

Deprecated

the ‘oc_type’ parameter is deprecated and will be removed without replacement in a future MORe release. Please use only the ‘name’ parameter to specify the output case.

Example

>>> from more.api import ApiGateway
>>> api = ApiGateway(proj=proj)
>>> simulation_setup = api.create_simulation_setup()
>>> output_case_container_setup = simulation_setup.create_output_case_container_setup()
>>> output_case_setup = output_case_container_setup.get_output_case_setup(name='Example OC') # This Load Case must already exist
Parameters:

name (str) – The name of the existing output case for which to return a OutputCaseSetupPipeline

Returns:

A OutputCaseSetupPipeline object for the found output case

Return type:

OutputCaseSetupPipeline

Raises:

NameNotFoundError – Raised if no output case with the given name was found

abstractmethod remove_output_case_setup(oc_type: str | None = None, name: str | None = None) OutputCaseContainerSetup[source]

Removes a output case

Deprecated

the ‘oc_type’ parameter is deprecated and will be removed without replacement in a future MORe release. Please use only the ‘name’ parameter to specify the output case to remove.

Example

>>> from more.api import ApiGateway
>>> api = ApiGateway(proj=proj)
>>> simulation_setup = api.create_simulation_setup()
>>> output_case_container_setup = simulation_setup.create_output_case_container_setup()
>>> output_case_setup = output_case_container_setup.remove_output_case_setup(name='Example OC') # This Load Case must already exist
Parameters:

name (str) – The name of the existing output case to remove

Returns:

self

Return type:

OutputCaseContainerSetup

Raises:

NameNotFoundError – Raised if no output case with the given name was found

abstractmethod set_name(name: str, resolve_duplicate_name: bool = False)[source]

Sets the name of the output case container

Example

>>> from more.api import ApiGateway
>>> api = ApiGateway(proj=proj)
>>> simulation_setup = api.create_simulation_setup()
>>> output_case_container_setup = simulation_setup.create_output_case_container_setup()
>>> output_case_container_setup.set_name(name='new_name')
<more...>
>>> simulation_setup.create_output_case_container_setup() \
...     .set_name(name='new_name', resolve_duplicate_name=True) \
...     .get_name()
'new_name 1'
Parameters:
  • name (str) – The new name for the output case container

  • resolve_duplicate_name (bool) – Whether to automatically assign a new name when the chosen one is already taken

Returns:

self

Return type:

OutputCaseContainerSetup

Raises:
  • NameNotUniqueError – Raised if the given name is not unique

  • TypeError – Raised if the given name is not a string