Skip to content

Commit

Permalink
Merge branch 'nov20' of github.com:bjodah/chempy into nov20
Browse files Browse the repository at this point in the history
  • Loading branch information
bjodah committed Jan 17, 2025
2 parents cba1a43 + 88fd2f5 commit 34ed552
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 19 deletions.
12 changes: 3 additions & 9 deletions .ci/ci-01-install.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/bin/bash
set -euxo pipefail
source /opt-3/cpython-v3.*-apt-deb/bin/activate
export CPATH=$SUNDBASE/include:${CPATH:-}
export LIBRARY_PATH=$SUNDBASE/lib
export LD_LIBRARY_PATH=$SUNDBASE/lib
source /opt-3/cpython-v3.*-apt-deb/bin/activate
PYTHON=python
INSTALL_PIP_FLAGS="--cache-dir $CACHE_ROOT/pip_cache ${INSTALL_PIP_FLAGS:-}" # --user
for pypkg in pyodeint pygslodeiv2 pycompilation pycodeexport pycvodes pykinsol sym pyodesys; do
Expand Down Expand Up @@ -40,17 +40,11 @@ for pypkg in pyodeint pygslodeiv2 pycompilation pycodeexport pycvodes pykinsol s
#( cd /tmp; $PYTHON -m pytest -k "not pool_discontinuity_approx" --pyargs $pypkg )
done

$PYTHON -m pip install $INSTALL_PIP_FLAGS -e .[all]
$PYTHON -c "import pycvodes; import pyodesys; import pygslodeiv2"
$PYTHON -m pip install $INSTALL_PIP_FLAGS -e .[all]
[[ $(python3 setup.py --version) =~ ^[0-9]+.* ]]
#git fetch -tq
$PYTHON setup.py sdist # test pip installable sdist (checks MANIFEST.in)
git archive -o dist/chempy-head.zip HEAD # test pip installable zip (symlinks break)
mkdir -p deploy/public_html/branches/${CI_COMMIT_BRANCH}
cp dist/chempy-* deploy/public_html/branches/${CI_COMMIT_BRANCH}/

set +e
[[ $($PYTHON setup.py --version) =~ ^[0-9]+.* ]]
./scripts/run_tests.sh --cov chempy --cov-report html
bash
./scripts/coverage_badge.py htmlcov/ htmlcov/coverage.svg

12 changes: 6 additions & 6 deletions .ci/ci-02-run-tests.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!/bin/bash
set -euxo pipefail
source /opt-3/cpython-v3.*-apt-deb/bin/activate

[[ $(python3 setup.py --version) =~ ^[0-9]+.* ]]
export \
PYODESYS_CVODE_FLAGS="-isystem $SUNDBASE/include -isystem /usr/include/suitesparse" \
PYODESYS_CVODE_LDFLAGS="-Wl,--disable-new-dtags -Wl,-rpath,$SUNDBASE/lib -L$SUNDBASE/lib"

export CPATH=$SUNDBASE/include:${CPATH:-}
export LIBRARY_PATH=$SUNDBASE/lib
export LD_LIBRARY_PATH=$SUNDBASE/lib
PYTHON=python
INSTALL_PIP_FLAGS="--cache-dir $CACHE_ROOT/pip_cache ${INSTALL_PIP_FLAGS:-}" # --user
$PYTHON -m pip install $INSTALL_PIP_FLAGS -e .[all]
./scripts/run_tests.sh --cov chempy --cov-report html
./scripts/coverage_badge.py htmlcov/ htmlcov/coverage.svg
4 changes: 2 additions & 2 deletions chempy/chemistry.py
Original file line number Diff line number Diff line change
Expand Up @@ -482,10 +482,10 @@ def from_string(cls, string, substance_keys=None, globals_=None, **kwargs):
>>> r4 = Reaction.from_string("A -> 2 B; 'k'", 'A B')
>>> r4.rate(dict(A=3, B=5, k=7)) == {'A': -3*7, 'B': 2*3*7}
True
>>> r5 = Reaction.from_string("A -> B; 1/molar/second", 'A B')
>>> r5 = Reaction.from_string("A -> B; 1/molar/second", 'A B') # doctest: +IGNORE_EXCEPTION_DETAIL
Traceback (most recent call last):
...
ValueError: Unable to convert between units ...
ValueError: Incompatible units
Notes
Expand Down
4 changes: 2 additions & 2 deletions chempy/units.py
Original file line number Diff line number Diff line change
Expand Up @@ -651,10 +651,10 @@ class Backend(object):
>>> math.exp(3*km) == math.exp(3*m)
True
>>> be = Backend('math')
>>> be.exp(3*km)
>>> be.exp(3*km) # doctest: +IGNORE_EXCEPTION_DETAIL
Traceback (most recent call last):
...
ValueError: Unable to convert between units of "km" and "dimensionless"
ValueError: Incompatible units
>>> import numpy as np
>>> np.sum([1000*pq.metre/pq.kilometre, 1])
1001.0
Expand Down

0 comments on commit 34ed552

Please sign in to comment.