Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle local parameters (again). #22

Merged
merged 10 commits into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/actions/setup-poetry-env/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: "setup-poetry-env"
description: "Composite action to setup the Python and poetry environment."

inputs:
python-version:
required: false
description: "The python version to use"
default: "3.11"

runs:
using: "composite"
steps:
- name: Set up python
uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python-version }}

- name: Install Poetry
env:
POETRY_VERSION: "1.7.1"
run: curl -sSL https://install.python-poetry.org | python - -y
shell: bash

- name: Add Poetry to Path
run: echo "$HOME/.local/bin" >> $GITHUB_PATH
shell: bash

# - name: Configure Poetry virtual environment in project
# run: poetry config virtualenvs.in-project true
# shell: bash

- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v4
with:
path: .venv
key: venv-${{ runner.os }}-${{ inputs.python-version }}-${{ hashFiles('poetry.lock') }}

- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction
shell: bash
38 changes: 7 additions & 31 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,36 +70,11 @@ jobs:
#############################################
## Install package and its dependencies
#############################################
- name: Install Python
uses: actions/setup-python@v3
with:
python-version: '3.11'

- name: Setup pip cache
uses: actions/cache@v3
with:
path: /opt/hostedtoolcache/Python
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements.optional.txt') }}
restore-keys: |
${{ runner.os }}-pip-

- name: Install libXML2
run: |
sudo apt-get update -y
sudo apt-get install -y --no-install-recommends libxml2

- name: Install pip
run: |
python -m pip install pip==23.0.0
python -m pip install pip==23.0.0
python -m pip --version
#python -m pip install --upgrade setuptools
#python -m setuptools --version


- name: Install package
run: |
python -m pip install .[all]
# install package
- name: Set up the environment
uses: ./.github/actions/setup-poetry-env
with:
python-version: "3.11"

#############################################
## Lint
Expand All @@ -125,6 +100,7 @@ jobs:
fi

echo "version=$version" >> $GITHUB_OUTPUT
echo "version=$version"

- id: get-docker-image-tag
name: Determine Docker image tag
Expand Down Expand Up @@ -172,7 +148,7 @@ jobs:
run: python -m pytest tests/ --cov=biosimulators_tellurium --cov-report=xml

- name: Upload the coverage report to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: unittests
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# -o /root/out

# Base OS
FROM python:3.9-slim-buster
FROM python:3.11-slim-buster

ARG VERSION="0.1.25"
ARG SIMULATOR_VERSION="2.2.10"
Expand All @@ -29,7 +29,7 @@ LABEL \
org.opencontainers.image.vendor="BioSimulators Team" \
org.opencontainers.image.licenses="Apache-2.0" \
\
base_image="python:3.9-slim-buster" \
base_image="python:3.11-slim-buster" \
version="${VERSION}" \
software="tellurium" \
software.version="${SIMULATOR_VERSION}" \
Expand Down
2 changes: 1 addition & 1 deletion biosimulators_tellurium/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.1.43'
__version__ = '0.1.44'
5 changes: 3 additions & 2 deletions biosimulators_tellurium/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,8 @@ def preprocess_sed_task(task, variables, config=None, simulator_config=None):
warning_summary='Model `{}` may be invalid.'.format(model.id))

# read model
road_runner = roadrunner.RoadRunner(model.source)
road_runner = roadrunner.RoadRunner()
road_runner = roadrunner.RoadRunner(road_runner.getParamPromotedSBML(model.source))

# get algorithm to execute
algorithm_substitution_policy = get_algorithm_substitution_policy(config=config)
Expand Down Expand Up @@ -583,7 +584,7 @@ def get_model_change_target_tellurium_change_map(model_etree, changes, alg_kisao
Returns:
:obj:`dict`: dictionary that maps the targets of changes to their corresponding tellurium identifiers
"""
change_targets_to_sbml_ids = validation.validate_target_xpaths(changes, model_etree, attr='id')
change_targets_to_sbml_ids = validation.validate_target_xpaths(changes, model_etree, attr='id', separator="_")

species_ids = model.getFloatingSpeciesIds() + model.getBoundarySpeciesIds()
component_ids = species_ids + model.getGlobalParameterIds() + model.getCompartmentIds()
Expand Down
Loading