From 29470a6d407e2587c5da135441038f3667d2cb2e Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Wed, 3 Aug 2016 18:15:20 -0500 Subject: [PATCH] Rearrange geo_lookup/area_query documentation --- boxtree/area_query.py | 50 ++++++++++++++++++++++++++++++++++++++++--- boxtree/geo_lookup.py | 14 ++++++++++++ boxtree/version.py | 1 - doc/conf.py | 2 +- doc/lookup.rst | 30 ++------------------------ 5 files changed, 64 insertions(+), 33 deletions(-) diff --git a/boxtree/area_query.py b/boxtree/area_query.py index 63d6fd2..73727d7 100644 --- a/boxtree/area_query.py +++ b/boxtree/area_query.py @@ -35,6 +35,27 @@ import logging logger = logging.getLogger(__name__) +__doc__ = """ +Area queries (Balls -> overlapping leaves) +------------------------------------------ + +.. autoclass:: AreaQueryBuilder + +.. autoclass:: AreaQueryResult + + +Peer Lists +^^^^^^^^^^ + +Area queries are implemented using peer lists. + +.. autoclass:: PeerListFinder + +.. autoclass:: PeerListLookup + +""" + + # {{{ output class PeerListLookup(DeviceDataRecord): @@ -50,10 +71,14 @@ class PeerListLookup(DeviceDataRecord): contains the list of peer boxes of box `box_id`. .. attribute:: peer_lists + + .. automethod:: get + + .. versionadded:: 2016.1 """ -class AreaQuery(DeviceDataRecord): +class AreaQueryResult(DeviceDataRecord): """ .. attribute:: tree @@ -67,6 +92,10 @@ class AreaQuery(DeviceDataRecord): results in a list of leaf boxes that intersect `ball_nr`. .. attribute:: leaves_near_ball_lists + + .. automethod:: get + + .. versionadded:: 2016.1 """ # }}} @@ -299,9 +328,15 @@ void generate(LIST_ARG_DECL USER_ARG_DECL box_id_t box_id) # }}} +# {{{ area query build + class AreaQueryBuilder(object): """Given a set of :math:`l^\infty` "balls", this class helps build a look-up table from ball to leaf boxes that intersect with the ball. + + .. versionadded:: 2016.1 + + .. automethod:: __call__ """ def __init__(self, context): self.context = context @@ -393,7 +428,7 @@ class AreaQueryBuilder(object): instances for whose completion this command waits before starting exeuction. :returns: a tuple *(aq, event)*, where *lbl* is an instance of - :class:`AreaQuery`, and *event* is a :class:`pyopencl.Event` + :class:`AreaQueryResult`, and *event* is a :class:`pyopencl.Event` for dependency management. """ @@ -435,11 +470,15 @@ class AreaQueryBuilder(object): logger.info("area query: done") - return AreaQuery( + return AreaQueryResult( tree=tree, leaves_near_ball_starts=result["leaves"].starts, leaves_near_ball_lists=result["leaves"].lists).with_queue(None), evt +# }}} + + +# {{{ peer list build class PeerListFinder(object): """This class builds a look-up table from box numbers to peer boxes. The @@ -457,6 +496,10 @@ class PeerListFinder(object): .. [1] Rachh, Manas, Andreas Klöckner, and Michael O'Neil. "Fast algorithms for Quadrature by Expansion I: Globally valid expansions." + + .. versionadded:: 2016.1 + + .. automethod:: __call__ """ def __init__(self, context): @@ -557,5 +600,6 @@ class PeerListFinder(object): peer_list_starts=result["peers"].starts, peer_lists=result["peers"].lists).with_queue(None), evt +# }}} # vim: filetype=pyopencl:fdm=marker diff --git a/boxtree/geo_lookup.py b/boxtree/geo_lookup.py index d328628..a241fb8 100644 --- a/boxtree/geo_lookup.py +++ b/boxtree/geo_lookup.py @@ -33,6 +33,15 @@ from boxtree.tools import AXIS_NAMES, DeviceDataRecord import logging logger = logging.getLogger(__name__) +__doc__ = """ +Leaves -> overlapping balls +--------------------------- + +.. autoclass:: LeavesToBallsLookupBuilder + +.. autoclass:: LeavesToBallsLookup +""" + # {{{ output @@ -53,6 +62,8 @@ class LeavesToBallsLookup(DeviceDataRecord): this list is indexed by the global box index. .. attribute:: balls_near_box_lists + + .. automethod:: get """ # }}} @@ -120,6 +131,9 @@ class _KernelInfo(Record): class LeavesToBallsLookupBuilder(object): """Given a set of :math:`l^\infty` "balls", this class helps build a look-up table from leaf boxes to balls that overlap with each leaf box. + + .. automethod:: __call__ + """ def __init__(self, context): self.context = context diff --git a/boxtree/version.py b/boxtree/version.py index 403f67f..9bf5997 100644 --- a/boxtree/version.py +++ b/boxtree/version.py @@ -1,3 +1,2 @@ VERSION = (2013, 1) VERSION_TEXT = ".".join(str(i) for i in VERSION) - diff --git a/doc/conf.py b/doc/conf.py index a8e9d7e..aa16335 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -135,7 +135,7 @@ html_sidebars = { # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ['_static'] +html_static_path = [] # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. diff --git a/doc/lookup.rst b/doc/lookup.rst index 3fd1d9d..6a1fca6 100644 --- a/doc/lookup.rst +++ b/doc/lookup.rst @@ -1,34 +1,8 @@ Tree-based geometric lookup =========================== -.. module:: boxtree.geo_lookup +.. automodule:: boxtree.geo_lookup -.. autoclass:: LeavesToBallsLookupBuilder - - .. automethod:: __call__ - -.. autoclass:: LeavesToBallsLookup - - .. automethod:: get - -.. module:: boxtree.area_query - -.. autoclass:: AreaQueryBuilder - - .. automethod:: __call__ - -.. autoclass:: AreaQuery - - .. automethod:: get - -Area queries are implemented using peer lists. - -.. autoclass:: PeerListFinder - - .. automethod:: __call__ - -.. autoclass:: PeerListLookup - - .. automethod:: get +.. automodule:: boxtree.area_query .. vim: sw=4 -- GitLab