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

infer models from ORM / AiiDA DB layer #1

Open
ltalirz opened this issue May 24, 2021 · 1 comment
Open

infer models from ORM / AiiDA DB layer #1

ltalirz opened this issue May 24, 2021 · 1 comment
Labels
enhancement New feature or request later Won't be handled during GSOC

Comments

@ltalirz
Copy link
Member

ltalirz commented May 24, 2021

Reimplementing the entity models (node, user, ...) from scratch is quite straightforward with pydantic, and probably the quickest way to start.

Ideally, at some point however we should try to infer the models, either from AiiDA's public ORM interface or from the underlying django/sqlalchemy DB models.

Note: An intermediate solution may be to embed the pydantic models in the ORM in some way in order to at least keep these two close together.

@ltalirz ltalirz added later Won't be handled during GSOC enhancement New feature or request labels May 24, 2021
@chrisjsewell
Copy link
Member

As noted in #26 (comment),
technically, we should maybe be getting this information from subclasses of aiida/orm/implementation/entities.py::BackendEntity or aiida/orm/entities.py:Entity.
But neither of these really provides an easy (programmatic) way to retrieve the "fields" required either to instantiate an entity (their name, type and description), or the "fields" that can be used with the QueryBuilder.
This is compounded by the fact you have these disconnects with the QueryBuilder, like name -> label for computers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request later Won't be handled during GSOC
Projects
None yet
Development

No branches or pull requests

2 participants