@@ -51,6 +51,8 @@ class EoS(BaseCalculation):
5151 Whether to attach a logger. Default is False.
5252 log_kwargs : Optional[dict[str, Any]]
5353 Keyword arguments to pass to `config_logger`. Default is {}.
54+ track_carbon : bool
55+ Whether to track carbon emissions of calculation. Default is True.
5456 tracker_kwargs : Optional[dict[str, Any]]
5557 Keyword arguments to pass to `config_tracker`. Default is {}.
5658 min_volume : float
@@ -112,6 +114,7 @@ def __init__(
112114 set_calc : Optional [bool ] = None ,
113115 attach_logger : bool = False ,
114116 log_kwargs : Optional [dict [str , Any ]] = None ,
117+ track_carbon : bool = True ,
115118 tracker_kwargs : Optional [dict [str , Any ]] = None ,
116119 min_volume : float = 0.95 ,
117120 max_volume : float = 1.05 ,
@@ -155,6 +158,8 @@ def __init__(
155158 Whether to attach a logger. Default is False.
156159 log_kwargs : Optional[dict[str, Any]]
157160 Keyword arguments to pass to `config_logger`. Default is {}.
161+ track_carbon : bool
162+ Whether to track carbon emissions of calculation. Default is True.
158163 tracker_kwargs : Optional[dict[str, Any]]
159164 Keyword arguments to pass to `config_tracker`. Default is {}.
160165 min_volume : float
@@ -241,6 +246,7 @@ def __init__(
241246 set_calc = set_calc ,
242247 attach_logger = attach_logger ,
243248 log_kwargs = log_kwargs ,
249+ track_carbon = track_carbon ,
244250 tracker_kwargs = tracker_kwargs ,
245251 file_prefix = file_prefix ,
246252 )
@@ -313,17 +319,19 @@ def run(self) -> EoSResults:
313319
314320 if self .logger :
315321 self .logger .info ("Starting of fitting equation of state" )
322+ if self .tracker :
316323 self .tracker .start_task ("Fit EoS" )
317324
318325 v_0 , e_0 , bulk_modulus = eos .fit ()
319326 # transform bulk modulus unit in GPa
320327 bulk_modulus *= 1.0e24 / kJ
321328
322329 if self .logger :
330+ self .logger .info ("Equation of state fitting complete" )
331+ if self .tracker :
323332 emissions = self .tracker .stop_task ().emissions
324333 self .struct .info ["emissions" ] = emissions
325334 self .tracker .stop ()
326- self .logger .info ("Equation of state fitting complete" )
327335
328336 if self .write_results :
329337 with open (f"{ self .file_prefix } -eos-fit.dat" , "w" , encoding = "utf8" ) as out :
@@ -346,6 +354,7 @@ def _calc_volumes_energies(self) -> None:
346354 """Calculate volumes and energies for all lattice constants."""
347355 if self .logger :
348356 self .logger .info ("Starting calculations for configurations" )
357+ if self .tracker :
349358 self .tracker .start_task ("Calculate configurations" )
350359
351360 cell = self .struct .get_cell ()
@@ -380,6 +389,7 @@ def _calc_volumes_energies(self) -> None:
380389 )
381390
382391 if self .logger :
392+ self .logger .info ("Calculations for configurations complete" )
393+ if self .tracker :
383394 emissions = self .tracker .stop_task ().emissions
384395 self .struct .info ["emissions" ] = emissions
385- self .logger .info ("Calculations for configurations complete" )
0 commit comments