-
Notifications
You must be signed in to change notification settings - Fork 1
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 #13 from vivarium-collective/api
feat: base-implementation and content for verification api
- Loading branch information
Showing
42 changed files
with
9,250 additions
and
3,745 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
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
232 changes: 187 additions & 45 deletions
232
biosimulator_processes/data_model/compare_data_model.py
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
from typing import * | ||
from tempfile import mkdtemp | ||
import requests | ||
import zipfile as zf | ||
import os | ||
|
||
|
||
def fetch_sbml_file(biomodel_id: str, save_dir: Optional[str] = None) -> str: | ||
url = f'https://www.ebi.ac.uk/biomodels/search/download?models={biomodel_id}' | ||
headers = {'accept': '*/*'} | ||
response = requests.get(url, headers=headers) | ||
model_filename = f'{biomodel_id}.xml' | ||
dirpath = save_dir or mkdtemp() # os.getcwd() | ||
response_zip_fp = os.path.join(dirpath, 'results.zip') | ||
if not os.path.exists(response_zip_fp): | ||
try: | ||
with open(response_zip_fp, 'wb') as f: | ||
f.write(response.content) | ||
|
||
with zf.ZipFile(response_zip_fp, 'r') as zipRef: | ||
zipRef.extract(model_filename, dirpath) | ||
|
||
os.remove(response_zip_fp) | ||
return os.path.join(dirpath, model_filename) | ||
except Exception as e: | ||
print(e) |
Binary file modified
BIN
+1 Byte
(100%)
biosimulator_processes/processes/__pycache__/__init__.cpython-310.pyc
Binary file not shown.
Binary file modified
BIN
+1 Byte
(100%)
biosimulator_processes/processes/__pycache__/cobra_process.cpython-310.pyc
Binary file not shown.
Binary file modified
BIN
+2.4 KB
(130%)
biosimulator_processes/processes/__pycache__/copasi_process.cpython-310.pyc
Binary file not shown.
Binary file modified
BIN
+1 Byte
(100%)
biosimulator_processes/processes/__pycache__/smoldyn_process.cpython-310.pyc
Binary file not shown.
Binary file modified
BIN
+128 Bytes
(100%)
biosimulator_processes/processes/__pycache__/tellurium_process.cpython-310.pyc
Binary file not shown.
Oops, something went wrong.