Skip to content

Commit

Permalink
Add pipes documentation and improve home page (#243)
Browse files Browse the repository at this point in the history
* Added pipes documentation and polished home page

* Fix set_sig_figs documentation

* Add core.units to __init__.py imports
  • Loading branch information
HannahSi authored Sep 16, 2019
1 parent 1392988 commit 0eb8b17
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 11 deletions.
1 change: 1 addition & 0 deletions aguaclara/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions aguaclara/core/units.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions docs/source/core/core.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ Core
drills
materials
physchem
pipes
units
utility
5 changes: 5 additions & 0 deletions docs/source/core/pipes.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Pipes
=====

.. automodule:: aguaclara.core.pipes
:members:
40 changes: 35 additions & 5 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
@@ -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 <http://aguaclara.cee.cornell.edu/>`_. 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 <http://aguaclara.cee.cornell.edu/>`_ 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 <https://github.com/AguaClara/aguaclara>`_.

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 <https://pint.readthedocs.io/en/latest/>`_), 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
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.'
Expand Down

0 comments on commit 0eb8b17

Please sign in to comment.