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

Mention new feature of process functions accepting base Python types #459

Open
sphuber opened this issue Oct 19, 2022 · 0 comments
Open

Comments

@sphuber
Copy link
Contributor

sphuber commented Oct 19, 2022

AiiDA v2.1 added a feature where inputs of process functions are automatically serialized (aiidateam/aiida-core#5688). See the docs.
Essentially, what used to be written as:

from aiida.engine import calcfunction
from aiida.orm import Int

@calcfunction
def add(x, y):
    return x + y

add(Int(1), Int(2))

can now be written as

from aiida.engine import calcfunction

@calcfunction
def add(x, y):
    return x + y

add(1, 2)

We should update the tutorials to explain this. Probably still first show the original version, making it clear that the function is a process and requires inputs as nodes, but then showing that for base types, there is a shortcut.

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

1 participant