src.spyice.utils.helpers#

src.spyice.utils.helpers.export_residuals(self, residuals, temperature_mushy, phi_mushy, salinity_mushy, output_dir)[source]#

Exports the residuals to a file.

Parameters:
  • residuals (np.array) – The residuals to export.

  • output_dir (str) – The output directory to save the residuals to.

Returns:

None

src.spyice.utils.helpers.set_dataclass(data_to_be_converted, dataclass)[source]#

Sets the values of a dataclass object using a dictionary.

Parameters:
  • data_to_be_converted (dict) – The dictionary containing the data to be converted.

  • dataclass (dataclass) – The dataclass object to be updated.

Returns:

The updated dataclass object.

Return type:

dataclass

src.spyice.utils.helpers.t_total(t_passed, dt)[source]#

Computes total time passed based on current time step dt and, total time of previous time step.

Parameters:
  • t_passed (float) – The time that has already passed.

  • dt (float) – The time increment.

Returns:

The total time.

Return type:

float