Skip to content

Commit

Permalink
Merge pull request #16 from SylvainCorlay/api_reference
Browse files Browse the repository at this point in the history
Add API reference documentation
  • Loading branch information
SylvainCorlay committed Sep 23, 2016
2 parents f38a372 + 970bf49 commit b3b8225
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ coverage.xml

# Sphinx documentation
docs/_build/
docs/source/_generate/

# PyBuilder
target/
Expand Down
20 changes: 19 additions & 1 deletion docs/source/api_documentation.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,22 @@
API Reference Documentation
---------------------------

.. automodule:: traittypes
The ``SciType`` trait type is the base trait type for all Scipy trait types.

It complements the ``traitlets.TraitType`` with a special API to register custom
validators.

.. autoclass:: traittypes.traittypes.SciType
:members:

The ``Array`` trait type holds a numpy Array.

.. autoclass:: traittypes.traittypes.Array

The ``DataFrame`` trait type holds a pandas DataFrame.

.. autoclass:: traittypes.traittypes.DataFrame

The ``Series`` trait type holds a pandas Series.

.. autoclass:: traittypes.traittypes.Series
2 changes: 0 additions & 2 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,4 @@ traittypes: Trait Types for Scientific Python

introduction
usage

..
api_documentation
5 changes: 3 additions & 2 deletions traittypes/traittypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

class SciType(TraitType):

"""A base traittype for numpy arrays, pandas dataframes and series."""
"""A base trait type for numpy arrays, pandas dataframes and series."""

def valid(self, *validators):
"""
Expand All @@ -24,7 +24,8 @@ def valid(self, *validators):
Example
-------
.. code-block:: python
.. code:: python
# Test with a shape constraint
def shape(*dimensions):
def validator(trait, value):
Expand Down

0 comments on commit b3b8225

Please sign in to comment.