netket.errors.LogAdditionalDataSignatureDeprecationWarning#
- exception netket.errors.LogAdditionalDataSignatureDeprecationWarning[source]#
Warning issued when a driver subclass overrides
_log_additional_datawith the old two-argument signature(self, log_dict, step)instead of the current one-argument signature(self, log_dict).The
stepparameter was removed because the current step is always accessible asself.step_countinside the method body.NetKet will automatically wrap your old implementation so that it continues to work, but you should update your code to silence this warning.
Examples
Instead of:
class MyDriver(nk.driver.AbstractOptimizationDriver): def _log_additional_data(self, log_dict: dict, step: int): log_dict["my_value"] = self.compute_something(step)
Use:
class MyDriver(nk.driver.AbstractOptimizationDriver): def _log_additional_data(self, log_dict: dict): super()._log_additional_data(log_dict) log_dict["my_value"] = self.compute_something(self.step_count)