netket.errors.LogAdditionalDataSignatureDeprecationWarning

netket.errors.LogAdditionalDataSignatureDeprecationWarning#

exception netket.errors.LogAdditionalDataSignatureDeprecationWarning[source]#

Warning issued when a driver subclass overrides _log_additional_data with the old two-argument signature (self, log_dict, step) instead of the current one-argument signature (self, log_dict).

The step parameter was removed because the current step is always accessible as self.step_count inside 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)