add queries for adding new tables and routes for molecule data download #53
+396
−110
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
this PR adds API routes for downloading data as CSV. It requires importing data for each data type (
ml
,dft
, xtb,
xtb_ni`) into new tables for each data type.The added API endpoints are
/api/molecules/data/export/{molecule_id}
/api/molecules/data/export?molecule_id=X,Y,Z
The first API endpoint retrieves data for a particular molecule ID. The second retrieves for multiple molecules based on ID. Both return
ml
data by default. Different data can be returned by adding a parameterdata_type=SOMETHING
where something can beml
,xtb
,xtb_ni
, ordft
Pandas is added as a dependency to allow use of reading SQL results into a dataframe
pd.read_sql_query
and to allow pivoting of data from long format to wide format.