SelfConsistentHubbardWorkChain
: Relabeling of HubbardStructure
if relaxations are skipped
#63
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #61.
@bastonero I moved the relabeling to a separate method, as discussed. I decided to introduce a new method in
SelfConsistentHubbardWorkChain
, instead of a new utility function in a separate module, to directly access the context of theWorkChain
. The relabeling logic is the same as before and the method takes also care of generating an appropriate message to be passed toself.report
.In this new version, the
HubbardStructure
would also be relabeled ifmeta_convergence == False
. If you would like to stick to the current logic, in the sense, that it's not updated, I could simply add anif
-statement to the method. This is up to you.The name of the method is of course debatable as well. I wasn't a 100% happy with the current name, as it also checks whether an update is necessary and might not relabel the structure. However, something like
should_relabel...
would indicate that abool
is returned. Moreover,update_hubbard...
seemed a bit too general.Tests have been adjusted as well and I added another one, to check if the correct reporting messages are provided.