diff --git a/.gitignore b/.gitignore index e478bbef..368ef00c 100644 --- a/.gitignore +++ b/.gitignore @@ -25,3 +25,4 @@ build/ .ipython/ .jupyter/* !.jupyter/jupyter_notebook_config.py +.*cache/ diff --git a/CHANGES.rst b/CHANGES.rst index 741ea976..6f7f8459 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,3 +1,7 @@ +v0.6.7 +====== +- Updated manuscript for JOSS. + v0.6.6 ====== - Support for containers in ``chempy.units.unit_of``. diff --git a/chempy/chemistry.py b/chempy/chemistry.py index 589bb5b0..9dd9a5d2 100644 --- a/chempy/chemistry.py +++ b/chempy/chemistry.py @@ -125,7 +125,7 @@ def molar_mass(self, units=None): -------- >>> nh4p = Substance.from_formula('NH4+') # simpler >>> from chempy.units import default_units as u - >>> nh4p.molar_mass(u) + >>> nh4p.molar_mass(u) # doctest: +ELLIPSIS array(18.0384511...) * g/mol """ diff --git a/chempy/kinetics/ode.py b/chempy/kinetics/ode.py index cfba19ab..44e42a58 100644 --- a/chempy/kinetics/ode.py +++ b/chempy/kinetics/ode.py @@ -159,8 +159,8 @@ def get_odesys(rsys, include_params=True, substitutions=None, SymbolicSys=None, >>> odesys, extra = get_odesys(rsys) >>> init_conc = {'Fe+3': 1.0, 'SCN-': .3, 'FeSCN+2': 0} >>> tout, Cout, info = odesys.integrate(5, init_conc) - >>> Cout[-1, :].round(4) - array([ 0.7042, 0.0042, 0.2958]) + >>> Cout[-1, :].round(4) # doctest: +NORMALIZE_WHITESPACE + array([0.7042, 0.0042, 0.2958]) """ if SymbolicSys is None: diff --git a/chempy/reactionsystem.py b/chempy/reactionsystem.py index 7e6959f9..dbc8ad1e 100644 --- a/chempy/reactionsystem.py +++ b/chempy/reactionsystem.py @@ -50,8 +50,8 @@ class ReactionSystem(object): >>> from chempy import Reaction >>> r1 = Reaction({'R1': 1}, {'P1': 1}, 42.0) >>> rsys = ReactionSystem([r1], 'R1 P1') - >>> rsys.as_per_substance_array({'R1': 2, 'P1': 3}) - array([ 2., 3.]) + >>> rsys.as_per_substance_array({'R1': 2, 'P1': 3}) # doctest: +NORMALIZE_WHITESPACE + array([2., 3.]) Raises ------ diff --git a/chempy/units.py b/chempy/units.py index 6bb734c4..36bf9900 100644 --- a/chempy/units.py +++ b/chempy/units.py @@ -558,8 +558,8 @@ class Backend(object): >>> np.sum([1000*pq.metre/pq.kilometre, 1]) 1001.0 >>> be_np = Backend(np) - >>> be_np.sum([[1000*pq.metre/pq.kilometre, 1], [3, 4]], axis=1) - array([ 2., 7.]) + >>> be_np.sum([[1000*pq.metre/pq.kilometre, 1], [3, 4]], axis=1) # doctest: +NORMALIZE_WHITESPACE + array([2., 7.]) """ diff --git a/chempy/util/stoich.py b/chempy/util/stoich.py index 91f45751..c55e03b3 100644 --- a/chempy/util/stoich.py +++ b/chempy/util/stoich.py @@ -62,8 +62,8 @@ def decompose_yields(yields, rxns, atol=1e-10): >>> from chempy import Reaction >>> h2a = Reaction({'H2O': 1}, {'H2': 1, 'O': 1}) >>> h2b = Reaction({'H2O': 1}, {'H2': 1, 'H2O2': 1}, inact_reac={'H2O': 1}) - >>> decompose_yields({'H2': 3, 'O': 2, 'H2O2': 1}, [h2a, h2b]) - array([ 2., 1.]) + >>> decompose_yields({'H2': 3, 'O': 2, 'H2O2': 1}, [h2a, h2b]) # doctest: +NORMALIZE_WHITESPACE + array([2., 1.]) Raises ------ diff --git a/examples/kinetics.png b/examples/kinetics.png index b68ede83..03f214dd 100644 Binary files a/examples/kinetics.png and b/examples/kinetics.png differ diff --git a/scripts/generate_docs.sh b/scripts/generate_docs.sh index 4a148835..9544b6cb 100755 --- a/scripts/generate_docs.sh +++ b/scripts/generate_docs.sh @@ -25,6 +25,7 @@ sed -i "s/$MATCH/$NEW/g" doc/conf.py sed -i "s/alabaster/sphinx_rtd_theme/g" doc/conf.py if [[ $NARGS -eq 3 ]]; then cat <>doc/conf.py + context = { 'conf_py_path': '/doc/', 'github_user': '$1', diff --git a/setup.cfg b/setup.cfg index 618680d9..68e181e6 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,6 @@ [tool:pytest] norecursedirs = .* _* build dist conda-recipe scripts benchmarks doc deploy venv +doctest_optionflags= NORMALIZE_WHITESPACE pep8maxlinelength=119 pep8ignore = doc/conf.py ALL # conf.py is a generated file