Skip to content

Commit

Permalink
Add a better error message
Browse files Browse the repository at this point in the history
  • Loading branch information
olupton committed Jun 21, 2023
1 parent 7092989 commit ca63149
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/nrn-modeldb-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ jobs:
python -m pip install $NEURON_V1
fi
nrn_ver=`python -c "from neuron import __version__ as nrn_ver; print(nrn_ver)"`
ps uxf # debug
runmodels --gout --workdir=$nrn_ver $MODELS_TO_RUN
# Filter out the gout data before generating HTML reports. The HTML
# diff uses the original gout files on disk anyway. Compress the large
Expand All @@ -186,7 +185,6 @@ jobs:
python -m pip install $NEURON_V2
fi
nrn_ver=`python -c "from neuron import __version__ as nrn_ver; print(nrn_ver)"`
ps uxf # debug
runmodels --gout --workdir=$nrn_ver $MODELS_TO_RUN
# Filter out the gout data before generating HTML reports. The HTML
# diff uses the original gout files on disk anyway. Compress the large
Expand Down
7 changes: 7 additions & 0 deletions modeldb/modeldb.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,13 @@ def query(field):
}
# If we were passed a non-None `model_list`, restrict those models now.
if model_list is not None:
missing_ids = set(model_list) - set(metadata.keys())
if len(missing_ids):

This comment has been minimized.

Copy link
@ramcdougal

ramcdougal Jun 21, 2023

Member

don't need the len here, could just:

if missing_ids:
raise Exception(
"Model IDs {} were explicitly requested, but are not known NEURON models.".format(
missing_ids
)
)
metadata = {model_id: metadata[model_id] for model_id in model_list}
# For each model in `metadata`, check if a cached entry exists and is
# up to date. If not, download it.
Expand Down

0 comments on commit ca63149

Please sign in to comment.