-
Notifications
You must be signed in to change notification settings - Fork 22
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
AiiDAEnsemble: add missing self.init()
#335
AiiDAEnsemble: add missing self.init()
#335
Conversation
Fixes SSCHAcode#334 The version update v1.4.1 missed to add the new `init` function to the `compute_ensemble` method of the auxiliary class `AiiDAEnsemble`. The simple fix makes the calculation using this class comparable to the traditional `Ensemble` class.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, I do not see the "init" function in 'compute_ensemble'. Why not use a __init__
method to automatically initialize the object?, that way you don't need to call a self.init().
@@ -100,6 +100,7 @@ def compute_ensemble( | |||
self.stress_computed = copy(self.force_computed) | |||
|
|||
self._clean_runs() | |||
self.init() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @diegomartinez2 , thanks for reviewing the code. As you cans see, the function is called here, at the end of the compute_ensemble
method. This mimics the behaviour of the Ensemble
class. The AiiDAEnsemble
in facts subclasses the Ensemble
one, hence it is provided with this method. This function (def init()
), according to documentation, must be called after the calculation of the ensemble, not to initialize the object itself.
@diegomartinez2 We have this in Ensemble.compute_ensemble if timer:
timer.execute_timed_function(self.init)
else:
self.init() Since the AiiDA Ensemble is overwriting the compute_ensemble, by missing the self.init there prevents the correct initialization of the fourier gradient calculation (and consequently the wrong minimization). |
We could use this patch for 1.4.2 since a long time is probably required for 1.5, and we have tons of small fixes to tdscha and cell constructor that have occurred since the last release. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The edit is minimal and the testsuite is passing. It should be merged without problems
Fixes #334
The version update v1.4.1 missed to add the new
init
function to thecompute_ensemble
method of the auxiliary classAiiDAEnsemble
. The simple fix makes the calculation using this class comparable to the traditionalEnsemble
class.