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

references is missing #17

Open
CasperWA opened this issue Dec 7, 2019 · 4 comments · May be fixed by #13
Open

references is missing #17

CasperWA opened this issue Dec 7, 2019 · 4 comments · May be fixed by #13
Labels
enhancement New feature or request

Comments

@CasperWA
Copy link
Collaborator

CasperWA commented Dec 7, 2019

The /references endpoint is missing.

Since references cannot be saved as a base Node in AiiDA databases, I suggest this endpoint utilizes a mongomock database, where the data is put into a JSON file, the path to which can be set in a central config file. Like what is proposed in #14.

@CasperWA CasperWA added the enhancement New feature or request label Dec 7, 2019
@CasperWA CasperWA linked a pull request Dec 7, 2019 that will close this issue
@ltalirz
Copy link
Member

ltalirz commented Dec 7, 2019

Since references cannot be saved as a base Node in AiiDA databases

Well, not in Node but in all Data nodes. See
https://github.com/aiidateam/aiida-core/blob/develop/aiida/orm/nodes/data/data.py#L33

One just has to actually do it.

@CasperWA
Copy link
Collaborator Author

CasperWA commented Dec 8, 2019

Since references cannot be saved as a base Node in AiiDA databases

Well, not in Node but in all Data nodes. See
https://github.com/aiidateam/aiida-core/blob/develop/aiida/orm/nodes/data/data.py#L33

One just has to actually do it.

Right. I didn't mean that we couldn't create a new Data class for references. It was more the fact that it doesn't exist yet, and will not exist for, e.g., the databases on Material Cloud's Archive, I guess?
Or do you think it makes sense to add a ReferenceData node to AiiDA core and later on as an addition to already published archive databases?

Or did I miss something in your link reference?

As a note, I am aware that this repository should be a separate entity, but since it is closely related to exposing the Materials Cloud archive databases at the moment, I think it makes most sense to implement a solution that can work for them.

@ltalirz
Copy link
Member

ltalirz commented Dec 8, 2019

Or did I miss something in your link reference?

Yes, you can attach source attributes to every Data node
https://github.com/aiidateam/aiida-core/blob/develop/aiida/orm/nodes/data/data.py#L78
(one just has to actually set them)

We should probably discuss with @giovannipizzi @sphuber what is needed to make them compatible with what is needed in optimade & whether these should be updated/generalized. I think they are used so far only by the "DB importers/exporters".

@ltalirz
Copy link
Member

ltalirz commented Dec 8, 2019

You are right, though, that it may be worth reconsidering the question whether replicating reference information on each node is the way to go.

In the end, however, I guess we are talking about a few hundred bytes per node, which is manageable at the scale of DBs that AiiDA currently supports (~1 million nodes), so introducing some relation between nodes and a ReferenceData node may actually introduce more complication than it saves.

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

Successfully merging a pull request may close this issue.

2 participants