ProgressBar#
- class fridom.framework.modules.progress_bar.ProgressBar[source]#
Bases:
ModuleA progress bar module to display the progress of the simulation.
Description#
The progress bar class is a wrapper around the tqdm progress bar. It has a custom format and handles the output to the stdout when the stdout is a file.
Parameters#
- disablebool
Whether to disable the progress bar.
Methods
__init__()disable()Enabling the module means that it will be executed at each time step.
enable()Enabling the module means that it will be executed at each time step.
is_enabled()Return whether the module is enabled or not.
reset()Stop and start the module.
set_options(main_loop_type, ...)setup(mset)Start the module
start()Start the module
stop()Stop the module
update(mz)Update the module
Attributes
diff_moduleThe differentiation module to be used by this module.
gridThe grid of the model settings
infoReturn a dictionary with information about the time stepper.
interp_moduleThe interpolation module to be used by this module.
msetThe model settings
required_halo- name = 'Progress Bar'#
- start() None[source]#
Start the module
Description#
This method is called at the beginning of the model run. Child classes that require a start method (for example to start an output writer) should overwrite this method. Make sure to decorate the method with the @module_method decorator.
- stop() None[source]#
Stop the module
Description#
This method is called by the model at the end of the model run or when the model is reset. Child classes that require a stop method (for example to close an output file) should overwrite this method. Make sure to decorate the method with the @module_method decorator.
- set_options(main_loop_type: str, datetime_formatting: bool, start_value: float | int, final_value: float | int)[source]#
- update(mz: ModelState) ModelState[source]#
Update the module
Description#
This method is called by the model at each time step. Child classes should overwrite this method to update the module. Make sure to decorate the method with the @module_method decorator.
Parameters#
- mzfr.ModelState
The model state at the current time step.
Returns#
- fr.ModelState
The updated model state.