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

Should Process classes be allowed to contain references to ORM entities? #2515

Closed
ltalirz opened this issue Feb 22, 2019 · 0 comments · Fixed by #3466
Closed

Should Process classes be allowed to contain references to ORM entities? #2515

ltalirz opened this issue Feb 22, 2019 · 0 comments · Fixed by #3466
Assignees
Labels
type/question may redirect to mailinglist

Comments

@ltalirz
Copy link
Member

ltalirz commented Feb 22, 2019

At the moment, Process classes, such as work chains can contain references to ORM entities, e.g. as default values in the spec:
https://github.com/aiidateam/aiida_core/blob/b22f55155e7a602ac42b00edf62e57e4a458f55b/aiida/backends/tests/work/test_work_chain.py#L94

One problem with this is that it prevents creating a "clean slate" for tests:

  1. Test A imports and runs workchain X (running may not even be necessary).
  2. Database is reset as usual.
  3. Test B imports workchain X and tries to run it. It fails because the default values point to database entries that no longer exist.

As noticed in #2421 this can be hard to debug, since test A and B can be otherwise completely unrelated.

One suggestion by @sphuber is to switch to lambda functions for defaults of workchains

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/question may redirect to mailinglist
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants