Skip to content

Commit

Permalink
Tests: get benchmark model paths from python library
Browse files Browse the repository at this point in the history
Not all problems match the previous naming scheme anymore.
  • Loading branch information
dweindl committed Nov 6, 2024
1 parent 5a6a167 commit 726684c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/benchmark_models.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ jobs:
run: |
cd $PARPE_BASE/benchmark_collection \
&& git clone --depth 1 $BM_REPO_URL \
&& echo "BENCHMARK_COLLECTION=$(pwd)/Benchmark-Models-PEtab/Benchmark-Models/" >> $GITHUB_ENV
&& echo "BENCHMARK_COLLECTION=$(pwd)/Benchmark-Models-PEtab/Benchmark-Models/" >> $GITHUB_ENV \
&& . $PARPE_BASE/build/venv/bin/activate \
&& python -m pip install -e Benchmark-Models-PEtab/src/python
- name: Benchmark models --- tests
run: |
Expand Down
8 changes: 4 additions & 4 deletions benchmark_collection/import_and_run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ script_path=$(get_abs_filename "$(dirname "$BASH_SOURCE")")
parpe_dir=${script_path}/..
model_name=$(basename "${petab_model_dir}")
amici_model_dir=${script_path}/${model_name}
petab_yaml=${model_name}.yaml
petab_yaml=$(python -c "import benchmark_models_petab; print(benchmark_models_petab.get_problem_yaml_path('${model_name}'))")
output_file=tmp.out
hdf5_infile="parpe_${model_name}/${model_name}.h5"
estimate_exe="parpe_${model_name}/build/estimate_${model_name}"
Expand All @@ -47,7 +47,7 @@ amici_root="${AMICI_ROOT:-${parpe_dir}/deps/AMICI/}"
cd "${petab_model_dir}"

echo "Running petablint on ${petab_yaml}..."
petablint -v "${model_name}".yaml
petablint -v ${petab_yaml}

# problems we need to flatten
to_flatten=(
Expand All @@ -65,7 +65,7 @@ done
# import AMICI model
if [[ ! -d ${amici_model_dir} ]]; then
echo "Importing model..."
cmd="amici_import_petab --verbose ${model_name}.yaml -n ${model_name} -o ${amici_model_dir} ${flatten}"
cmd="amici_import_petab --verbose ${petab_yaml} -n ${model_name} -o ${amici_model_dir} ${flatten}"
echo "${cmd}"
${cmd}
fi
Expand All @@ -85,7 +85,7 @@ echo "Importing data..."
cmd="parpe_petab_to_hdf5 \
-o ${hdf5_infile} \
-d ${amici_model_dir} \
-y ${petab_model_dir}/${model_name}.yaml \
-y ${petab_yaml} \
-n ${model_name} \
--ignore-initialization-priors \
${flatten}"
Expand Down

0 comments on commit 726684c

Please sign in to comment.