aiidateam / aiida-quantumespresso

The official AiiDA plugin for Quantum ESPRESSO
https://aiida-quantumespresso.readthedocs.io
Other
53 stars 78 forks source link

Inform users of how to disable the automatic increase of bands #628

Closed giovannipizzi closed 3 years ago

giovannipizzi commented 3 years ago

The current logic is to try to increase bands even for insulators, except the user explicitly set the occupations to fixed. Since this is different from the default behaviour of QE (fixed should be the default) this is unexpected for many users who would know this behaviour only if they go in the code and understand what's going on (I had discussed this, and I ended up forgetting...), especially since the documentation (I think) is not ready yet.

Here I'm not suggesting to change the logic, but simply to add a reporting message here: https://github.com/aiidateam/aiida-quantumespresso/blob/2c6d02f69cf273cb5f78f6f9f39839d6397793ae/aiida_quantumespresso/workflows/pw/base.py#L346-L347

Where, if the occupations are not set explicitly, a report message explains what is going on, and that if the user is sure the material is insulating, they should set explicitly the occupations to fixed to avoid triggering this logic.

@mbercx @sphuber what do you think?

sphuber commented 3 years ago

So something like

occupations = calculation.inputs.parameters.get_attribute('SYSTEM', {}).get('occupations', None)

if occupations is None:
    self.report('`SYSTEM.occupations` parameter is not defined: performing band occupation check. If you want to disable this, explicitly set `SYSTEM.occupations` to `fixed`.)

if occupations == 'fixed':
    return

Would be fine for me. Documentation is indeed not ready, as in nothing has been written yet :sweat_smile: Hopefully @mbercx will be able to help out with this

mbercx commented 3 years ago

Would be fine for me. Documentation is indeed not ready, as in nothing has been written yet 😅 Hopefully @mbercx will be able to help out with this

Of course, I love writing documentation. 😉 I was originally planning to organise some documentation days before the holidays, but I'm not sure we'll get around to it. 😅 Sounds like the perfect new year's resolution however.

I agree it makes sense to add a report message here. I will demonstrate my remarkable copy-paste abilities and open a PR with @sphuber's suggestion.