From d343cf14a86adcb3d964175116e5eeb465f9d73f Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Tue, 3 May 2022 17:12:33 -0500 Subject: [PATCH] Mapper docs: move to module docstring, improve --- doc/mappers.rst | 20 +------------------- pymbolic/mapper/c_code.py | 4 ++++ pymbolic/mapper/collector.py | 4 ++++ pymbolic/mapper/constant_folder.py | 5 +++++ pymbolic/mapper/dependency.py | 5 +++++ pymbolic/mapper/differentiator.py | 4 ++++ pymbolic/mapper/distributor.py | 6 ++++++ pymbolic/mapper/evaluator.py | 11 +++++++++++ pymbolic/mapper/graphviz.py | 4 ++++ pymbolic/mapper/substitutor.py | 7 +++++++ 10 files changed, 51 insertions(+), 19 deletions(-) diff --git a/doc/mappers.rst b/doc/mappers.rst index c418427..93d39b4 100644 --- a/doc/mappers.rst +++ b/doc/mappers.rst @@ -3,7 +3,6 @@ Mappers .. automodule:: pymbolic.mapper - More specialized mappers ------------------------ @@ -14,44 +13,27 @@ Converting to strings and code .. automodule:: pymbolic.mapper.c_code -.. autoclass:: CCodeMapper - .. automodule:: pymbolic.mapper.graphviz -.. autoclass:: GraphvizMapper - - Some minimal mathematics ^^^^^^^^^^^^^^^^^^^^^^^^ .. automodule:: pymbolic.mapper.evaluator -.. autoclass:: EvaluationMapper - .. automodule:: pymbolic.mapper.differentiator -.. autoclass:: DifferentiationMapper - .. automodule:: pymbolic.mapper.distributor -.. autoclass:: DistributeMapper - .. automodule:: pymbolic.mapper.collector -.. autoclass:: TermCollector - .. automodule:: pymbolic.mapper.constant_folder - -.. autoclass:: ConstantFoldingMapper -.. autoclass:: CommutativeConstantFoldingMapper +.. automodule:: pymbolic.mapper.substitutor Finding expression properties ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. automodule:: pymbolic.mapper.dependency -.. autoclass:: DependencyMapper - .. automodule:: pymbolic.mapper.flop_counter .. autoclass:: FlopCounter diff --git a/pymbolic/mapper/c_code.py b/pymbolic/mapper/c_code.py index aed3867..13bd811 100644 --- a/pymbolic/mapper/c_code.py +++ b/pymbolic/mapper/c_code.py @@ -1,3 +1,7 @@ +""" +.. autoclass:: CCodeMapper +""" + __copyright__ = "Copyright (C) 2009-2013 Andreas Kloeckner" __license__ = """ diff --git a/pymbolic/mapper/collector.py b/pymbolic/mapper/collector.py index a092243..17865a1 100644 --- a/pymbolic/mapper/collector.py +++ b/pymbolic/mapper/collector.py @@ -1,3 +1,7 @@ +""" +.. autoclass:: TermCollector +""" + __copyright__ = "Copyright (C) 2009-2013 Andreas Kloeckner" __license__ = """ diff --git a/pymbolic/mapper/constant_folder.py b/pymbolic/mapper/constant_folder.py index 724c770..e8ab531 100644 --- a/pymbolic/mapper/constant_folder.py +++ b/pymbolic/mapper/constant_folder.py @@ -1,3 +1,8 @@ +""" +.. autoclass:: ConstantFoldingMapper +.. autoclass:: CommutativeConstantFoldingMapper +""" + __copyright__ = "Copyright (C) 2009-2013 Andreas Kloeckner" __license__ = """ diff --git a/pymbolic/mapper/dependency.py b/pymbolic/mapper/dependency.py index 09497da..b40f8c1 100644 --- a/pymbolic/mapper/dependency.py +++ b/pymbolic/mapper/dependency.py @@ -1,3 +1,8 @@ +""" +.. autoclass:: DependencyMapper +.. autoclass:: CachedDependencyMapper +""" + __copyright__ = "Copyright (C) 2009-2013 Andreas Kloeckner" __license__ = """ diff --git a/pymbolic/mapper/differentiator.py b/pymbolic/mapper/differentiator.py index be70be6..8d7d4dd 100644 --- a/pymbolic/mapper/differentiator.py +++ b/pymbolic/mapper/differentiator.py @@ -1,3 +1,7 @@ +""" +.. autoclass:: DifferentiationMapper +""" + __copyright__ = "Copyright (C) 2009-2013 Andreas Kloeckner" __license__ = """ diff --git a/pymbolic/mapper/distributor.py b/pymbolic/mapper/distributor.py index 13c9831..9f73efd 100644 --- a/pymbolic/mapper/distributor.py +++ b/pymbolic/mapper/distributor.py @@ -1,3 +1,9 @@ +""" +.. autoclass:: DistributeMapper +.. autofunction:: distribute +""" + + __copyright__ = "Copyright (C) 2009-2013 Andreas Kloeckner" __license__ = """ diff --git a/pymbolic/mapper/evaluator.py b/pymbolic/mapper/evaluator.py index 1f665e3..22fd397 100644 --- a/pymbolic/mapper/evaluator.py +++ b/pymbolic/mapper/evaluator.py @@ -1,3 +1,14 @@ +""" +.. autoclass:: EvaluationMapper +.. autoclass:: CachedEvaluationMapper +.. autoclass:: FloatEvaluationMapper +.. autoclass:: CachedFloatEvaluationMapper + +.. autofunction:: evaluate +.. autofunction:: evaluate_kw +.. autofunction:: evaluate_to_float +""" + __copyright__ = "Copyright (C) 2009-2013 Andreas Kloeckner" __license__ = """ diff --git a/pymbolic/mapper/graphviz.py b/pymbolic/mapper/graphviz.py index edc88ec..71eb3cb 100644 --- a/pymbolic/mapper/graphviz.py +++ b/pymbolic/mapper/graphviz.py @@ -1,3 +1,7 @@ +""" +.. autoclass:: GraphvizMapper +""" + __copyright__ = "Copyright (C) 2015 Andreas Kloeckner" __license__ = """ diff --git a/pymbolic/mapper/substitutor.py b/pymbolic/mapper/substitutor.py index abddfa7..d294d23 100644 --- a/pymbolic/mapper/substitutor.py +++ b/pymbolic/mapper/substitutor.py @@ -1,3 +1,10 @@ +""" +.. autoclass:: SubstitutionMapper +.. autoclass:: CachedSubstitutionMapper +.. autofunction:: make_subst_func +.. autofunction:: substitute + +""" __copyright__ = "Copyright (C) 2009-2013 Andreas Kloeckner" __license__ = """ -- GitLab