spyice.preprocess package#
Submodules#
- src.spyice.preprocess.geometry_settings
- src.spyice.preprocess.initial_boundary_conditions
SalinityUnavailableErrorboundary_condition()calculate_boundary_salinity()calculate_boundary_temperature()compute_melting_temperature_from_salinity()raise_salinity_exception()set_boundary_temperature()set_inital_salinity()set_inital_temperature()set_initial_conditions()set_initial_liquidfraction()t_w3()temperature_gradient()
- src.spyice.preprocess.modify_initial_boundary
- src.spyice.preprocess.pre_process
- Classes
- Functions
- src.spyice.preprocess.store
Module contents#
- class src.spyice.preprocess.PreProcess[source]#
Bases:
UserInput,GeometrySettings,ResultsParamsClass for preprocessing data before modeling.
Initialize the PreProcess class. :param config_data: The configuration data object. :type config_data: ConfigData :param output_dir: The output directory. :type output_dir: str
- Raises:
None –
- Returns:
None
- __init__(constants_type, config_data, output_dir)[source]#
Initialize the PreProcess class. :param config_data: The configuration data object. :type config_data: ConfigData :param output_dir: The output directory. :type output_dir: str
- Raises:
None –
- Returns:
None
- get_userinput()[source]#
Returns a UserInput object with the following attributes:
- Parameters:
self (PreProcess) – The PreProcess instance.
- Returns:
- A UserInput object with the following attributes:
constants: The constants attribute.
grid_timestep_dt: The grid_timestep_dt attribute.
initial_salinity: The initial_salinity attribute.
dir_output_name: The dir_output_name attribute.
max_iterations: The max_iterations attribute.
- Return type:
- classmethod get_variables(config, out_dir_final)[source]#
Retrieves variables and user input data after preprocessing.
- Parameters:
cls – The class object.
config – The configuration object.
out_dir_final (Path | str) – The output directory.
- Returns:
A tuple containing the filtered variables and user input data.
- Return type:
tuple[PreprocessData, UserInput]
- preprocess()[source]#
Preprocesses the data before running the simulation. This method sets up the initial conditions and boundary conditions for the simulation. It calculates the solid enthalpy and updates the enthalpy based on temperature, salinity, and liquid fraction. Finally, it initializes the ice thickness and prints a message indicating that the initial and boundary conditions have been applied.
- Args:
None
- static preprocess_jupyter(self)[source]#
Preprocesses the data before running the simulation. This method sets up the initial conditions and boundary conditions for the simulation. It calculates the solid enthalpy and updates the enthalpy based on temperature, salinity, and liquid fraction. Finally, it initializes the ice thickness and prints a message indicating that the initial and boundary conditions have been applied.
- Args:
None
- Parameters:
self (PreprocessData)
- static set_dataclass(data_to_be_converted, dataclass)[source]#
Sets the attributes of a dataclass object using a dictionary.
- Parameters:
data_to_be_converted (dict) – A dictionary containing the attribute names and values to be set.
dataclass (dataclass) – The dataclass object to be modified.
- Returns:
The modified dataclass object with the attributes set.
- Return type:
dataclass