Skip to content

Commit

Permalink
Use Rich library in the CLI (#47)
Browse files Browse the repository at this point in the history
* Use Rich library in the CLI

* Improve reporting capabilities

Co-authored-by: Felipe S. S. Schneider <[email protected]>
  • Loading branch information
schneiderfelipe and Felipe S. S. Schneider authored Nov 23, 2020
1 parent 5095fcb commit 8733d93
Show file tree
Hide file tree
Showing 8 changed files with 483 additions and 471 deletions.
12 changes: 7 additions & 5 deletions INSTALL.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@ The package, together with the above dependencies, can be installed from

pip install overreact

Optionally, extra functionality is provided by
`thermo <https://github.com/CalebBell/thermo>`_::
Optionally, extra functionality is provided such as a command-line interface
and solvent properties::

pip install 'overreact[thermo]'
pip install 'overreact[cli,solvents]'

This last line installs thermo as well. thermo is used to calculate the
dynamic viscosity of solvents in the context of the
This last line installs `Rich <https://github.com/willmcgugan/rich>`_
and `thermo <https://github.com/CalebBell/thermo>`_ as well.
Rich is used in the command-line interface, and thermo is used
to calculate the dynamic viscosity of solvents in the context of the
:doc:`tutorials/collins-kimball` for diffusion-limited reactions.
925 changes: 466 additions & 459 deletions overreact/cli.py

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions overreact/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,8 @@ def _get_chemical(
):
"""Wrap `thermo.Chemical`.
This function is used for obtaining property values and requires the `thermo` package.
All parameters are passed to `thermo.Chemical` and the returned object is
returned.
Expand Down
2 changes: 1 addition & 1 deletion overreact/rates.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
def liquid_viscosity(id, temperature=298.15, pressure=constants.atm):
"""Dynamic viscosity of a solvent.
This function uses the `thermo` package.
This function requires the `thermo` package for obtaining property values.
Parameters
----------
Expand Down
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
cclib==1.6.3
cclib>=1.6.3
scipy>=1.4.0
matplotlib>=2.1.1
pytest>=5.2.1
rich>=9.2.0
thermo>=0.1.39
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
setup(
name="overreact",
version=open("VERSION").read().strip(),
description="A Python package for constructing microkinetic models",
description="Construct precise chemical microkinetic models from first principles",
author="Felipe Silveira de Souza Schneider",
author_email="[email protected]",
url="https://github.com/schneiderfelipe/overreact",
packages=find_packages(),
entry_points={"console_scripts": ["overreact = overreact.cli:main"]},
install_requires=["cclib>=1.6.3", "scipy>=1.4.0"],
extras_require={"thermo": ["thermo>=0.1.39"]},
tests_require=["pytest>=5.2.1"],
extras_require={"cli": ["rich>=9.2.0"], "solvents": ["thermo>=0.1.39"],},
tests_require=["matplotlib>=2.1.1", "pytest>=5.2.1"],
)
2 changes: 1 addition & 1 deletion tests/test_thermo_gas.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python3

"""Tests for gas phase using the thermo module."""
"""Tests for gas phase using the `thermo` module."""

import numpy as np
import pytest
Expand Down
2 changes: 1 addition & 1 deletion tests/test_thermo_solv.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python3

"""Tests for solvation using the thermo module."""
"""Tests for solvation using the `thermo` module."""

import pytest

Expand Down

0 comments on commit 8733d93

Please sign in to comment.