TransientPartialFindCreatorSetup¶
Qualified name: transient_data_table.scripting_api.transient_partial_find_creator_setup.TransientPartialFindCreatorSetup
- class transient_data_table.scripting_api.transient_partial_find_creator_setup.TransientPartialFindCreatorSetup(partial_find_creator_getter: Callable[[], Any], partial_find_creator: Any)[source]¶
Bases:
PartialFindCreatorSetup
Class for handling the querying of transient data tables in load cases
To create an instance the following steps may be taken:
Example
>>> from more.api import ApiGateway >>> import numpy as np >>> simulation_setup = ApiGateway(proj=proj).create_simulation_setup() >>> lcc_setup = simulation_setup.create_load_case_container_setup() >>> load_case_setup = lcc_setup.create_load_case_setup(lc_type='Mechanical load case') >>> data_table_setup = simulation_setup \ ... .create_data_table_setup(data_table_type_name='Transient data table') \ ... .set_name(name='data_table_name_1') >>> var_val, data_val = np.array([0, 0.3, 0.6]), np.array([[0, 1e-3, 2e-3], [1, 2, 3]]) >>> data_table_setup = data_table_setup \ ... .set_data(var=var_val, data=data_val) >>> print("Available data tables: {}".format(load_case_setup.available_data_table_names)) # To check which data tables are available Available data tables: ... >>> load_case_setup = load_case_setup \ ... .set_data_table_by_name(data_table_name='data_table_name_1') \ ... .set_time_dependent_data_bool(value=True) >>> lc_data_table_query_config = load_case_setup.get_data_table_query_config()
In the methods below it is assumed that a lc_data_table_query_config variable contains an object of this class as created above, including the data_table_setup
Methods
Sets the chosen transient data table column to the name provided
Sets the chosen transient data table column to the index provided
- set_time_dependent_data_column_by_name(name: str) TransientPartialFindCreatorSetup [source]¶
Sets the chosen transient data table column to the name provided
Example
>>> data_table_setup = data_table_setup.set_column_name(index=1, new_name='New column name') >>> lc_data_table_query_config = lc_data_table_query_config.set_time_dependent_data_column_by_name(name='New column name')
- Parameters:
name (str) – The name of the column to set
- Returns:
This transient query config object
- Return type:
self
- Raises:
StaleReferentError – Raised if the data table chosen in the corresponding load case has changed and this query config is no longer valid
NameNotFoundError – Raised if the name of the data table column was not found
TypeError – Raised if the given index is not a string
- set_time_dependent_data_column_index(index: int) TransientPartialFindCreatorSetup [source]¶
Sets the chosen transient data table column to the index provided
Example
>>> lc_data_table_query_config = lc_data_table_query_config.set_time_dependent_data_column_index(index=1)
- Parameters:
index (int) – The index of the column to set
- Returns:
This transient query config object
- Return type:
self
- Raises:
StaleReferentError – Raised if the data table chosen in the corresponding load case has changed and this query config is no longer valid
IndexNotFoundError – Raised if the given index is out of bounds
TypeError – Raised if the given index is not an integer