Skip to content

Commit

Permalink
Merge pull request #46 from bjodah/ode-multi-units
Browse files Browse the repository at this point in the history
Support integration of parameter series with units
  • Loading branch information
bjodah authored Apr 3, 2017
2 parents e46bf89 + 2a45b31 commit bbb10af
Show file tree
Hide file tree
Showing 49 changed files with 4,387 additions and 1,211 deletions.
6 changes: 5 additions & 1 deletion .drone.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
build:
image: bjodah/bjodahimg16dev:latest
environment:
- CPLUS_INCLUDE_PATH=/opt/boost_1_63_0/include
- LIBRARY_PATH=/opt/boost_1_63_0/lib
- LD_LIBRARY_PATH=/opt/boost_1_63_0/lib
commands:
- bash -c '[[ $(python setup.py --version) =~ ^[0-9]+.* ]]'
- export CPLUS_INCLUDE_PATH=/opt/boost_1_63_0
- ./scripts/ci.sh chempy
- PYCVODES_LAPACK=lapack,blas ./scripts/ci.sh chempy
- (cd examples/; python -m pip install --force bokeh==0.11.1; for f in bokeh_*.py; do python -m bokeh html $f; done)
- ./scripts/prepare_deploy.sh
- PATH=/opt/miniconda3/bin:$PATH conda config --add channels bjodah # sym, pyodesys, pyneqsys
Expand Down
16 changes: 16 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,22 @@ Chemical kinetics (system of ordinary differential equations)
.. image:: https://raw.githubusercontent.com/bjodah/chempy/master/examples/kinetics.png

Properties
~~~~~~~~~~
.. code:: python
>>> from chempy import Substance
>>> from chempy.properties.water_density_tanaka_2001 import water_density as rho
>>> from chempy.units import to_unitless, default_units as u
>>> water = Substance.from_formula('H2O')
>>> for T_C in (15, 25, 35):
... concentration_H2O = rho(T=(273.15 + T_C)*u.kelvin, units=u)/water.molar_mass(units=u)
... print('[H2O] = %.2f M (at %d °C)' % (to_unitless(concentration_H2O, u.molar), T_C))
...
[H2O] = 55.46 M (at 15 °C)
[H2O] = 55.35 M (at 25 °C)
[H2O] = 55.18 M (at 35 °C)
License
-------
Expand Down
3 changes: 2 additions & 1 deletion chempy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@

from ._url import __url__
from ._release import __version__
from .chemistry import Substance, Reaction, Equilibrium, ReactionSystem, Species, balance_stoichiometry, mass_fractions
from .chemistry import Substance, Reaction, Equilibrium, Species, balance_stoichiometry, mass_fractions
from .reactionsystem import ReactionSystem
from .henry import Henry
from .util.periodic import atomic_number

Expand Down
Loading

0 comments on commit bbb10af

Please sign in to comment.