Skip to content

Commit

Permalink
Raise HTTPError when downloading of engine results via URL fails and …
Browse files Browse the repository at this point in the history
…fix pyneuroml import to correct branch (for accessing correct version of biosimulations.submit_simulation_archive)

Co-authored-by: Robert Vickerstaff <[email protected]>
  • Loading branch information
stellaprins and robertvi committed Sep 26, 2024
1 parent 0f8917f commit bbdc622
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/non-omv-local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: Install dependencies
run: |
pip install git+https://github.com/OpenSourceBrain/osb-model-validation
pip install pyNeuroML pyNeuroML[annotations]
pip install pyNeuroML[annotations]
pip install python-libsedml
pip install tellurium
sudo apt-get install libncurses5 --fix-missing
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/non-omv-remote.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: Install dependencies
run: |
pip install git+https://github.com/OpenSourceBrain/osb-model-validation
pip install pyNeuroML pyNeuroML[annotations]
pip install pyNeuroML[annotations]
pip install python-libsedml
pip install tellurium
sudo apt-get install libncurses5 --fix-missing
Expand Down
11 changes: 8 additions & 3 deletions utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import glob
from pyneuroml import biosimulations
import pandas as pd
from requests.exceptions import HTTPError

engines = {
'amici': {
Expand Down Expand Up @@ -1033,7 +1034,7 @@ def download_file_from_link(engine, download_link, output_file='results.zip', ma
return filepath
else:
print(f'Failed to download {engine} results.')
return False
raise HTTPError(f'Failed to download {engine} results.')

# unzip the file in file_path if it is a zip file and remove the zip file, replace with the unzipped folder
def unzip_file(file_path, output_dir=None):
Expand Down Expand Up @@ -1144,11 +1145,15 @@ def run_biosimulators_remotely(sedml_file_name,
download_links_dict[e] = download_link

extract_dir_dict = dict()
results_remote = dict()
for e, link in download_links_dict.items():
extract_dir = get_remote_results(e, link, remote_output_dir)
try:
extract_dir = get_remote_results(e, link, remote_output_dir)
except HTTPError as emessage:
results_remote[e] = ["FAIL", str(emessage), type(emessage).__name__]
continue
extract_dir_dict[e] = extract_dir

results_remote = dict()
for e, extract_dir in extract_dir_dict.items():
status = ""
error_message = ""
Expand Down

0 comments on commit bbdc622

Please sign in to comment.