Skip to content

Commit

Permalink
Merge pull request #293 from eric-wieser/tweak-docs
Browse files Browse the repository at this point in the history
Manually tailor the class documentation pages
  • Loading branch information
eric-wieser committed Apr 2, 2020
2 parents 3c70a07 + 8ae7ec7 commit 93b0188
Show file tree
Hide file tree
Showing 29 changed files with 121 additions and 43 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,5 @@ target/

.mypy_cache
.ipynb_checkpoints

/docs/api/generated/*
22 changes: 12 additions & 10 deletions clifford/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
Note that typically the :doc:`predefined-algebras` are sufficient, and there is no need to build an algebra from scratch.
.. autosummary::
:toctree: generated/
:toctree:
Cl
conformalize
Whether you construct your algebras from scratch, or use the predefined ones, you'll end up working with the following types:
.. autosummary::
:toctree: generated/
:toctree:
MultiVector
Layout
Expand All @@ -43,28 +43,30 @@
==============================
These functions are used to change the global behavior of ``clifford``.
.. autosummary::
:toctree: generated/
.. autofunction:: eps
.. autofunction:: pretty
.. autofunction:: ugly
.. autofunction:: print_precision
eps
pretty
ugly
print_precision
Miscellaneous classes
=======================
.. autosummary::
:toctree: generated/
:toctree:
MVArray
Frame
BladeMap
Miscellaneous functions
=======================
.. autosummary::
:toctree: generated/
:toctree:
grade_obj
randomMV
Expand Down
4 changes: 0 additions & 4 deletions clifford/_blademap.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
from . import _utils


@_utils.set_module('clifford')
class BladeMap(object):
'''
A Map Relating Blades in two different algebras
Expand Down
2 changes: 0 additions & 2 deletions clifford/_conformal_layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@

from ._layout import Layout
from ._multivector import MultiVector
from . import _utils


@_utils.set_module('clifford')
class ConformalLayout(Layout):
r"""
A layout for a conformal algebra, which adds extra constants and helpers.
Expand Down
4 changes: 1 addition & 3 deletions clifford/_frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,11 @@
import numpy as np

from ._mvarray import MVArray
from ._multivector import MultiVector
from .operator import op
from . import _settings
from . import _utils
from ._multivector import MultiVector


@_utils.set_module('clifford')
class Frame(MVArray):
'''
A frame of vectors
Expand Down
2 changes: 0 additions & 2 deletions clifford/_layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
from . import _numba_utils
from .io import read_ga_file
from . import _settings
from . import _utils
from ._multivector import MultiVector
from ._layout_helpers import (
BasisBladeOrder, BasisVectorIds, canonical_reordering_sign_euclidean
Expand Down Expand Up @@ -176,7 +175,6 @@ def construct_graded_mt(
return sparse.COO(coords=coords, data=mult_table_vals, shape=(dims, dims, dims))


@_utils.set_module('clifford')
class Layout(object):
r""" Layout stores information regarding the geometric algebra itself and the
internal representation of multivectors.
Expand Down
3 changes: 0 additions & 3 deletions clifford/_layout_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import operator

from . import _numba_utils
from . import _utils
import numba
import numba.extending
import numba.types
Expand Down Expand Up @@ -73,7 +72,6 @@ def _is_unique(x) -> bool:
return len(x) == len(set(x))


@_utils.set_module('clifford')
class BasisBladeOrder:
""" Represents the storage order in memory of basis blade coefficients.
Expand Down Expand Up @@ -172,7 +170,6 @@ def __reduce__(self):
IdT = TypeVar('IdT')


@_utils.set_module('clifford')
class BasisVectorIds(Generic[IdT]):
"""
Stores ids for the ordered set of basis vectors, typically integers.
Expand Down
2 changes: 0 additions & 2 deletions clifford/_multivector.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@
import clifford as cf
from . import general_exp
from . import _settings
from . import _utils


@_utils.set_module('clifford')
class MultiVector(object):
"""An element of the algebra
Expand Down
2 changes: 0 additions & 2 deletions clifford/_mvarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@

from clifford.io import write_ga_file, read_ga_file # noqa: F401
from ._multivector import MultiVector
from . import _utils

dual_array = np.vectorize(MultiVector.dual)
normal_array = np.vectorize(MultiVector.normal)
call_array = np.vectorize(MultiVector.__call__)


@_utils.set_module('clifford')
class MVArray(np.ndarray):
'''
MultiVector Array
Expand Down
13 changes: 0 additions & 13 deletions clifford/_utils.py

This file was deleted.

File renamed without changes.
9 changes: 9 additions & 0 deletions docs/api/clifford.BasisBladeOrder.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
clifford.BasisBladeOrder
========================

.. currentmodule:: clifford

.. autoclass:: BasisBladeOrder
:members:
:undoc-members:
:member-order: bysource
9 changes: 9 additions & 0 deletions docs/api/clifford.BasisVectorIds.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
clifford.BasisVectorIds
========================

.. currentmodule:: clifford

.. autoclass:: BasisVectorIds
:members:
:undoc-members:
:member-order: bysource
9 changes: 9 additions & 0 deletions docs/api/clifford.BladeMap.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
clifford.BladeMap
=================

.. currentmodule:: clifford

.. autoclass:: BladeMap
:members:
:undoc-members:
:member-order: bysource
6 changes: 6 additions & 0 deletions docs/api/clifford.Cl.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
clifford.Cl
===========

.. currentmodule:: clifford

.. autofunction:: Cl
10 changes: 10 additions & 0 deletions docs/api/clifford.ConformalLayout.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
clifford.ConformalLayout
========================

.. currentmodule:: clifford

.. autoclass:: ConformalLayout
:members:
:undoc-members:
:show-inheritance:
:member-order: bysource
11 changes: 11 additions & 0 deletions docs/api/clifford.Frame.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
clifford.Frame
==============

.. currentmodule:: clifford

.. autoclass:: Frame
:members:
:undoc-members:
:no-inherited-members:
:show-inheritance:
:member-order: bysource
9 changes: 9 additions & 0 deletions docs/api/clifford.Layout.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
clifford.Layout
===============

.. currentmodule:: clifford

.. autoclass:: Layout
:members:
:member-order: bysource
:undoc-members:
11 changes: 11 additions & 0 deletions docs/api/clifford.MVarray.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
clifford.MVArray
================

.. currentmodule:: clifford

.. autoclass:: MVArray
:members:
:undoc-members:
:special-members: __call__
:no-inherited-members:
:show-inheritance:
11 changes: 11 additions & 0 deletions docs/api/clifford.MultiVector.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
clifford.MultiVector
====================

.. currentmodule:: clifford

.. autoclass:: MultiVector
:no-inherited-members:
:members:
:undoc-members:
:special-members: __add__, __sub__, __mul__, __xor__, __or__, __invert__, __and__, __getitem__, __call__
:member-order: bysource
6 changes: 6 additions & 0 deletions docs/api/clifford.conformalize.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
clifford.conformalize
=====================

.. currentmodule:: clifford

.. autofunction:: conformalize
6 changes: 6 additions & 0 deletions docs/api/clifford.grade_obj.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
clifford.grade\_obj
===================

.. currentmodule:: clifford

.. autofunction:: grade_obj
6 changes: 6 additions & 0 deletions docs/api/clifford.randomMV.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
clifford.randomMV
=================

.. currentmodule:: clifford

.. autofunction:: randomMV
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 2 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@
#autodoc_default_flags='members'
# you have to list all files with automodule here due to bug in sphinx and nbsphinx
# https://github.com/spatialaudio/nbsphinx/issues/14
autosummary_generate=['clifford','tools','cga']
autosummary_generate=['api/tools', 'api/cga']
autodoc_member_order = 'bysource'
numpydoc_show_class_members = True
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
Expand Down
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Scalars, vectors, and higher-grade entities can be mixed freely and consistently
:hidden:

Installation
api
api/index
predefined-algebras
changelog
issues
Expand Down

0 comments on commit 93b0188

Please sign in to comment.