Skip to content
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

New implementation of the input generator does not have inspection methods #234

Open
bosonie opened this issue Oct 17, 2021 · 1 comment
Assignees

Comments

@bosonie
Copy link
Collaborator

bosonie commented Oct 17, 2021

The various get_relax_types, get_electronic_types and so on are now missing. Just introspection of protocols have been preserved.

@sphuber
Copy link
Collaborator

sphuber commented Oct 18, 2021

This was done on purpose. This information can directly be retrieved from the ports in the specification, e.g.:

In [1]: from aiida_common_workflows.workflows.relax.quantum_espresso import QuantumEspressoCommonRelaxInputGenerator

In [2]: QuantumEspressoCommonRelaxInputGenerator.spec().inputs['electronic_type'].choices
Out[2]: (<ElectronicType.METAL: 'metal'>, <ElectronicType.INSULATOR: 'insulator'>)

In this way, not just the arguments for which we decided to add a special method is introspectable, and it is not just the choices, it also provides the valid type and all other information specified in the spec.

The one thing that I considered adding is a single method that essentially returns spec().inputs, so the line becomes:

In [2]: QuantumEspressoCommonRelaxInputGenerator.get_input_spec()['electronic_type'].choices
Out[2]: (<ElectronicType.METAL: 'metal'>, <ElectronicType.INSULATOR: 'insulator'>)

Name to be discussed. If we agree on it, I can add it and close this issue with it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants