From 0eb8b17f30d6926185ad896af244f3394d2e1ae1 Mon Sep 17 00:00:00 2001 From: Hannah Si <35944490+HannahSi@users.noreply.github.com> Date: Mon, 16 Sep 2019 01:22:41 -0400 Subject: [PATCH] Add pipes documentation and improve home page (#243) * Added pipes documentation and polished home page * Fix set_sig_figs documentation * Add core.units to __init__.py imports --- aguaclara/__init__.py | 1 + aguaclara/core/units.py | 10 +++++----- docs/source/core/core.rst | 1 + docs/source/core/pipes.rst | 5 +++++ docs/source/index.rst | 40 +++++++++++++++++++++++++++++++++----- setup.py | 2 +- 6 files changed, 48 insertions(+), 11 deletions(-) create mode 100644 docs/source/core/pipes.rst diff --git a/aguaclara/__init__.py b/aguaclara/__init__.py index 79fc1483..d01eaac7 100644 --- a/aguaclara/__init__.py +++ b/aguaclara/__init__.py @@ -4,6 +4,7 @@ from aguaclara.core.materials import * from aguaclara.core.physchem import * from aguaclara.core.pipes import * +from aguaclara.core.units import * from aguaclara.core.utility import * from aguaclara.design.cdc import CDC diff --git a/aguaclara/core/units.py b/aguaclara/core/units.py index 035ffbac..7b70b04e 100644 --- a/aguaclara/core/units.py +++ b/aguaclara/core/units.py @@ -48,16 +48,16 @@ "data", "unit_definitions.txt")) -def set_sig_figs(n): - """Set the default number of significant figures used to print pint, - pandas and numpy values quantities. Defaults to 4. +def set_sig_figs(n=4): + """Set the default number of significant figures used to print Pint, + Pandas and NumPy value quantities. - :param n: number of significant figures to display + :param n: number of significant figures to display. Defaults to 4. :type n: int :Examples: - >>> from aguaclara.core.units import set_sig_figs, u as u + >>> from aguaclara.core.units import set_sig_figs, u >>> h = 2.5532532522352543*u.m >>> e = 25532532522352543*u.m >>> print('h before sigfig adjustment:',h) diff --git a/docs/source/core/core.rst b/docs/source/core/core.rst index 36356989..bc989cc4 100644 --- a/docs/source/core/core.rst +++ b/docs/source/core/core.rst @@ -8,5 +8,6 @@ Core drills materials physchem + pipes units utility diff --git a/docs/source/core/pipes.rst b/docs/source/core/pipes.rst new file mode 100644 index 00000000..c688239b --- /dev/null +++ b/docs/source/core/pipes.rst @@ -0,0 +1,5 @@ +Pipes +===== + +.. automodule:: aguaclara.core.pipes + :members: diff --git a/docs/source/index.rst b/docs/source/index.rst index 2ab40ef3..16b876d1 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -1,13 +1,43 @@ -=========================== -Home -=========================== +=============================================== +Welcome to the AguaClara Package Documentation! +=============================================== .. image:: images/logo.png + :align: center -``aguaclara`` is a Python package built by `AguaClara Cornell `_. It contains Python classes for designing AguaClara water treatment plants and functions for water treatment research. +``aguaclara`` is a Python package built by `AguaClara Cornell `_ for AguaClara water treatment plant design and research. + +Installing +---------- +The ``aguaclara`` package can be installed by running ``pip install aguaclara`` in the command line. To upgrade an existing installation, run ``pip install aguaclara --upgrade``. + +Contributing +------------ +To report a bug or request or feature, make an issue in the `AguaClara package Github repository `_. + +Using ``aguaclara`` +------------------- +``aguaclara`` is organized into three sub-packages. + +1. **Core**: fundamental physical, chemical, and hydraulic functions and values +2. **Design**: modules for creating a parameterized design of an AguaClara water treatment plant +3. **Research**: modules for process modeling, experimental design, and data analysis in AguaClara research + +To use ``aguaclara``'s registry of scientific units (based on the `Pint package `_), use ``from aguaclara.core.units import u``. Any other function or value in a sub-package can be accessed by importing the package itself: + +.. code-block:: python + + import aguaclara as ac + from aguaclara.core.units import u + + ac.viscosity_kinematic(20 * u.degC) + +``aguaclara`` Reference +----------------------- +The following pages document the modules, functions, and values available in each sub-package. .. toctree:: - :maxdepth: 1 + :maxdepth: 2 core/core design/design diff --git a/setup.py b/setup.py index 4ac3b4b7..73051446 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ setup( name = 'aguaclara', - version = '0.1.8', + version = '0.1.9', description = ( 'An open-source Python package for designing and performing research ' 'on AguaClara water treatment plants.'