-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create progress bar for experiments #41
Comments
Some code already exists for this feature, very much WIP, ping to get access to this. |
@BenSchZA hello Ben! Would like to see the progress bar feature :) |
@WooSungD I have some code (somewhere) that I recall uses |
The following is pseudo-code, untested, but might give an idea of how to integrate using radCAD hooks: class CustomTQDM(tqdm):
"""A custom class that disables deepcopy for tqdm progress bars."""
def __deepcopy__(self, memo):
return self
@dataclass
class Parameters:
"""
A dataclass to store the parameters of the simulation
"""
progress_bar: CustomTQDM = CustomTQDM(total=0)
...
class CustomSimulationExecution(SimulationExecution):
def __init_subclass__(cls) -> None:
return super().__init_subclass__()
def before_subset(self):
"""
radCAD simulation hook called before each simulation parameter subset
"""
super().before_subset()
params: Parameters = self.context.parameters
params.progress_bar.total = int(self.context.timesteps)
def before_timestep(self):
"""
radCAD simulation hook called before each simulation timestep
"""
super().before_timestep()
params: Parameters = self.context.parameters
params.progress_bar.update(1) |
thanks for sharing the code @BenSchZA! as a start I think a single progress bar for overall simulation progress bar would be great :) will give this a crack once in our next model build |
Introduce a progress bar for long-running experiments, across runs/subsets/timesteps (granularity to be determined, to be most efficient).
progress
mode.The text was updated successfully, but these errors were encountered: