-
Notifications
You must be signed in to change notification settings - Fork 37
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
Adding the trajectories endpoint to OPTIMADE #377
base: develop
Are you sure you want to change the base?
Adding the trajectories endpoint to OPTIMADE #377
Conversation
08f1bf7
to
b907b2c
Compare
b907b2c
to
716ad2e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the hard work on this @JPBergsma!
My comments below are mostly around maintaining our compliance with the JSON:API format.
716ad2e
to
7c1b646
Compare
Placed all sentences on seperate lines.
7c1b646
to
a291b59
Compare
…eferences for frames.
…lso possible to do this via the next field in the links field of the JSON response.
Can we add an endpoint for bulk downloads? |
…gsma/OPTIMADE into JPBergsma_add_Trajectories
Co-authored-by: Rickard Armiento <gitcommits@armiento.net>
…t_frame and frame_step parameters for servers.
…gsma/OPTIMADE into JPBergsma_add_Trajectories # Conflicts: # optimade.rst
Co-authored-by: Antanas Vaitkus <antanas.vaitkus90@gmail.com>
… can contain multiple values.
}, | ||
{ | ||
"name":"H2", | ||
"chemical_symbols":["H"], | ||
"concentration":[1.0] | ||
} | ||
]], | ||
"reference_frames": [1], | ||
"nframes": [360], | ||
"_exmpl_temperature": null, | ||
"_exmpl_ekin": null | ||
}, | ||
"meta":{ | ||
"property_metadata":{ | ||
"cartesian_site_positions":{ | ||
"range":{ | ||
"indexable_dim": ["frames"], | ||
"data_range": [{ | ||
"start": 1, | ||
"step": 1, | ||
"stop": 360, | ||
},{ | ||
"start": 1, | ||
"step": 1, | ||
"stop": 3, | ||
},{ | ||
"start": 1, | ||
"step": 1, | ||
"stop": 3, | ||
}], | ||
"layout":"dense", | ||
"nvalues": 3240 | ||
}, | ||
}, | ||
"_exmpl_temperature":{ | ||
"range": { | ||
"nvalues": 144, | ||
"indexable_dim": ["frames"], | ||
"data_range": [ | ||
{ | ||
"start": 1, | ||
"stop": 360, | ||
"step": null | ||
} | ||
], | ||
"layout": "sparse" | ||
} | ||
}, | ||
"_exmpl_ekin":{ | ||
"range": { | ||
"nvalues": 180, | ||
"indexable_dim": ["frames"], | ||
"data_range": [ | ||
{ | ||
"start": 1, | ||
"stop": 360, | ||
"step": 2 | ||
} | ||
], | ||
"layout":"dense", | ||
} | ||
} | ||
}, | ||
"partial_data_links": { | ||
"cartesian_site_positions": [ | ||
{ | ||
"format": "jsonlines", | ||
"link": "https://example.org/optimade/v1.2/extensions/partial_data/trajectories/traj00000001/cartesian_site_positions/jsonlines" | ||
},{ | ||
"format": "_exmpl_xyz", | ||
"link": "https://example.org/optimade/v1.2/extensions/partial_data/trajectories/traj00000001/cartesian_site_positions/xyz" | ||
}, | ||
], | ||
"_exmpl_temperature": [ | ||
{ | ||
"format": "jsonlines", | ||
"link": "https://example.org/optimade/v1.2/extensions/partial_data/trajectories/traj00000001/temperature/jsonlines" | ||
}, | ||
], | ||
"_exmpl_ekin": [ | ||
{ | ||
"format": "jsonlines", | ||
"link": "https://example.org/optimade/v1.2/extensions/partial_data/trajectories/traj00000001/ekin/jsonlines" | ||
}, | ||
] | ||
} | ||
}, | ||
"relationships": { | ||
"references": { | ||
"data": [ | ||
{ | ||
"type": "references", | ||
"id": "dummy/2019" | ||
} | ||
] | ||
} | ||
} | ||
} | ||
//... | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{ | |
"data":{ | |
"id": "traj00000001", | |
"type": "trajectories", | |
"attributes": { | |
"last_modified":"2021-07-16T18:02:03Z", | |
"elements": [["H","O"]], | |
"nelements": [2], | |
"elements_ratios": [[0.666667,0.333333]], | |
"chemical_formula_descriptive": ["H2O"], | |
"chemical_formula_reduced": ["H2O"], | |
"chemical_formula_anonymous": ["A2B"], | |
"dimension_types":[[0,0,0]], | |
"nperiodic_dimensions": [0], | |
"lattice_vectors" : [[[4.0,0.0,0.0],[0.0,4.0,0.0],[0.0,0.0,4.0]]], | |
"cartesian_site_positions" : null, | |
"nsites":[3], | |
"species_at_sites":[["O1","H1","H2"]], | |
"species":[[ | |
{ | |
"name":"O1", | |
"chemical_symbols":["O"], | |
"concentration":[1.0] | |
}, | |
{ | |
"name":"H1", | |
"chemical_symbols":["H"], | |
"concentration":[1.0] | |
}, | |
{ | |
"name":"H2", | |
"chemical_symbols":["H"], | |
"concentration":[1.0] | |
} | |
]], | |
"reference_frames": [1], | |
"nframes": [360], | |
"_exmpl_temperature": null, | |
"_exmpl_ekin": null | |
}, | |
"meta":{ | |
"property_metadata":{ | |
"cartesian_site_positions":{ | |
"range":{ | |
"indexable_dim": ["frames"], | |
"data_range": [{ | |
"start": 1, | |
"step": 1, | |
"stop": 360, | |
},{ | |
"start": 1, | |
"step": 1, | |
"stop": 3, | |
},{ | |
"start": 1, | |
"step": 1, | |
"stop": 3, | |
}], | |
"layout":"dense", | |
"nvalues": 3240 | |
}, | |
}, | |
"_exmpl_temperature":{ | |
"range": { | |
"nvalues": 144, | |
"indexable_dim": ["frames"], | |
"data_range": [ | |
{ | |
"start": 1, | |
"stop": 360, | |
"step": null | |
} | |
], | |
"layout": "sparse" | |
} | |
}, | |
"_exmpl_ekin":{ | |
"range": { | |
"nvalues": 180, | |
"indexable_dim": ["frames"], | |
"data_range": [ | |
{ | |
"start": 1, | |
"stop": 360, | |
"step": 2 | |
} | |
], | |
"layout":"dense", | |
} | |
} | |
}, | |
"partial_data_links": { | |
"cartesian_site_positions": [ | |
{ | |
"format": "jsonlines", | |
"link": "https://example.org/optimade/v1.2/extensions/partial_data/trajectories/traj00000001/cartesian_site_positions/jsonlines" | |
},{ | |
"format": "_exmpl_xyz", | |
"link": "https://example.org/optimade/v1.2/extensions/partial_data/trajectories/traj00000001/cartesian_site_positions/xyz" | |
}, | |
], | |
"_exmpl_temperature": [ | |
{ | |
"format": "jsonlines", | |
"link": "https://example.org/optimade/v1.2/extensions/partial_data/trajectories/traj00000001/temperature/jsonlines" | |
}, | |
], | |
"_exmpl_ekin": [ | |
{ | |
"format": "jsonlines", | |
"link": "https://example.org/optimade/v1.2/extensions/partial_data/trajectories/traj00000001/ekin/jsonlines" | |
}, | |
] | |
} | |
}, | |
"relationships": { | |
"references": { | |
"data": [ | |
{ | |
"type": "references", | |
"id": "dummy/2019" | |
} | |
] | |
} | |
} | |
} | |
//... | |
} | |
{ | |
"data":{ | |
"id": "traj00000001", | |
"type": "trajectories", | |
"attributes": { | |
"last_modified":"2021-07-16T18:02:03Z", | |
"elements": [["H","O"]], | |
"nelements": [2], | |
"elements_ratios": [[0.666667,0.333333]], | |
"chemical_formula_descriptive": ["H2O"], | |
"chemical_formula_reduced": ["H2O"], | |
"chemical_formula_anonymous": ["A2B"], | |
"dimension_types":[[0,0,0]], | |
"nperiodic_dimensions": [0], | |
"lattice_vectors" : [[[4.0,0.0,0.0],[0.0,4.0,0.0],[0.0,0.0,4.0]]], | |
"cartesian_site_positions" : null, | |
"nsites":[3], | |
"species_at_sites":[["O1","H1","H2"]], | |
"species":[[ | |
{ | |
"name":"O1", | |
"chemical_symbols":["O"], | |
"concentration":[1.0] | |
}, | |
{ | |
"name":"H1", | |
"chemical_symbols":["H"], | |
"concentration":[1.0] | |
}, | |
{ | |
"name":"H2", | |
"chemical_symbols":["H"], | |
"concentration":[1.0] | |
} | |
]], | |
"reference_frames": [1], | |
"nframes": [360], | |
"_exmpl_temperature": null, | |
"_exmpl_ekin": null | |
}, | |
"meta":{ | |
"property_metadata":{ | |
"cartesian_site_positions":{ | |
"range":{ | |
"indexable_dim": ["frames"], | |
"data_range": [{ | |
"start": 1, | |
"step": 1, | |
"stop": 360 | |
},{ | |
"start": 1, | |
"step": 1, | |
"stop": 3 | |
},{ | |
"start": 1, | |
"step": 1, | |
"stop": 3 | |
}], | |
"layout":"dense", | |
"nvalues": 3240 | |
} | |
}, | |
"_exmpl_temperature":{ | |
"range": { | |
"nvalues": 144, | |
"indexable_dim": ["frames"], | |
"data_range": [ | |
{ | |
"start": 1, | |
"stop": 360, | |
"step": null | |
} | |
], | |
"layout": "sparse" | |
} | |
}, | |
"_exmpl_ekin":{ | |
"range": { | |
"nvalues": 180, | |
"indexable_dim": ["frames"], | |
"data_range": [ | |
{ | |
"start": 1, | |
"stop": 360, | |
"step": 2 | |
} | |
], | |
"layout":"dense" | |
} | |
} | |
}, | |
"partial_data_links": { | |
"cartesian_site_positions": [ | |
{ | |
"format": "jsonlines", | |
"link": "https://example.org/optimade/v1.2/extensions/partial_data/trajectories/traj00000001/cartesian_site_positions/jsonlines" | |
},{ | |
"format": "_exmpl_xyz", | |
"link": "https://example.org/optimade/v1.2/extensions/partial_data/trajectories/traj00000001/cartesian_site_positions/xyz" | |
} | |
], | |
"_exmpl_temperature": [ | |
{ | |
"format": "jsonlines", | |
"link": "https://example.org/optimade/v1.2/extensions/partial_data/trajectories/traj00000001/temperature/jsonlines" | |
} | |
], | |
"_exmpl_ekin": [ | |
{ | |
"format": "jsonlines", | |
"link": "https://example.org/optimade/v1.2/extensions/partial_data/trajectories/traj00000001/ekin/jsonlines" | |
} | |
] | |
} | |
}, | |
"relationships": { | |
"references": { | |
"data": [ | |
{ | |
"type": "references", | |
"id": "dummy/2019" | |
} | |
] | |
} | |
} | |
} | |
//... | |
} |
Co-authored-by: Antanas Vaitkus <antanas.vaitkus90@gmail.com>
During the OPTIMADE meeting in June 2021, we discussed in room 2 how the OPTIMADE standard could be expanded to allow the sharing of trajectory data. Based on the discussions with amongst others @giovannipizzi, @gmrigna, Adam Hospital, Tristan Bereau, Amit Gupta, Corey Oses, Ellad Tadmor, Maithilee Motlag, and Daniel S Karls, I have written a first draft for adding a trajectory endpoint. This will hopefully be a good base for further discussion.
The PR adds a trajectories section (in this PR section 7.3), that defines how a client can query and retrieve data from trajectories and how the server can share this data. We have tried to do this in a general way so that many different kinds of trajectories can be shared.