-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #53 from janash/feature/download
add queries for adding new tables and routes for molecule data download
- Loading branch information
Showing
5 changed files
with
396 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
CREATE TABLE ml_data ( | ||
molecule_id INTEGER, | ||
property TEXT, | ||
max DOUBLE PRECISION, | ||
min DOUBLE PRECISION, | ||
delta DOUBLE PRECISION, | ||
vburminconf DOUBLE PRECISION, | ||
boltzmann_average DOUBLE PRECISION | ||
); | ||
|
||
ALTER TABLE ml_data | ||
ADD CONSTRAINT fk_molecule_id | ||
FOREIGN KEY (molecule_id) REFERENCES molecule(molecule_id); | ||
|
||
CREATE INDEX idx_ml_data_molecule_id ON ml_data(molecule_id); | ||
|
||
\COPY ml_data FROM 'ml_data_json_table.csv' DELIMITER ',' CSV HEADER; | ||
|
||
CREATE TABLE dft_data ( | ||
molecule_id INTEGER, | ||
property TEXT, | ||
max DOUBLE PRECISION, | ||
min DOUBLE PRECISION, | ||
delta DOUBLE PRECISION, | ||
vburminconf DOUBLE PRECISION, | ||
boltzmann_average DOUBLE PRECISION | ||
); | ||
|
||
ALTER TABLE dft_data | ||
ADD CONSTRAINT fk_molecule_id | ||
FOREIGN KEY (molecule_id) REFERENCES molecule(molecule_id); | ||
|
||
CREATE INDEX idx_dft_data_molecule_id ON dft_data(molecule_id); | ||
|
||
\COPY dft_data FROM 'dft_data_json_table.csv' DELIMITER ',' CSV HEADER; | ||
|
||
CREATE TABLE xtb_data ( | ||
molecule_id INTEGER, | ||
property TEXT, | ||
max DOUBLE PRECISION, | ||
min DOUBLE PRECISION, | ||
boltzmann_average DOUBLE PRECISION | ||
); | ||
|
||
ALTER TABLE xtb_data | ||
ADD CONSTRAINT fk_molecule_id | ||
FOREIGN KEY (molecule_id) REFERENCES molecule(molecule_id); | ||
|
||
CREATE INDEX idx_xtb_data_molecule_id ON xtb_data(molecule_id); | ||
|
||
\COPY xtb_data FROM 'xtb_data_json_table.csv' DELIMITER ',' CSV HEADER; | ||
|
||
|
||
CREATE TABLE xtb_ni_data ( | ||
molecule_id INTEGER, | ||
property TEXT, | ||
boltzmann_average DOUBLE PRECISION, | ||
max DOUBLE PRECISION, | ||
min DOUBLE PRECISION | ||
); | ||
|
||
ALTER TABLE xtb_ni_data | ||
ADD CONSTRAINT fk_molecule_id | ||
FOREIGN KEY (molecule_id) REFERENCES molecule(molecule_id); | ||
|
||
CREATE INDEX idx_xtb_ni_data_molecule_id ON xtb_ni_data(molecule_id); | ||
|
||
\COPY xtb_ni_data FROM 'xtb_ni_data_json_table.csv' DELIMITER ',' CSV HEADER; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ dependencies: | |
- alembic | ||
- psycopg2-binary | ||
- sqlalchemy | ||
- pandas | ||
- tenacity | ||
- uvicorn | ||
- curl | ||
|
Oops, something went wrong.