Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update docs #262

Merged
merged 2 commits into from
Jan 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions docs/reference/composers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,25 @@ Composers
Class
=====

Subsample to Sample Composers
-----------------------------

.. autoclass:: IdentityComposer
.. autoclass:: SplatComposer

Sample Processors
-----------------

.. autoclass:: GreedyPathMerge
.. autoclass:: IsoenergeticClusterMove

Primitive Sample Operations
---------------------------

.. autoclass:: AggregatedSamples
.. autoclass:: ExplodeSamples
.. autoclass:: MergeSamples
.. autoclass:: SliceSamples

.. _composers-examples:

Expand Down
15 changes: 13 additions & 2 deletions docs/reference/core.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ Basic building-block classes and superclasses for hybrid workflows.
Classes
=======

.. autoclass:: Present
.. autoclass:: Runnable
.. autoclass:: State
.. autoclass:: States
.. autoclass:: SampleSet
.. autoclass:: Runnable


Properties
Expand All @@ -40,6 +40,17 @@ Methods
Runnable.next
Runnable.run
Runnable.stop
SampleSet.empty
SampleSet.hstack
SampleSet.vstack
State.copy
State.updated
State.result
State.from_problem
State.from_subproblem
State.from_sample
State.from_samples
State.from_subsample
State.from_subsamples
States.first
States.updated
2 changes: 2 additions & 0 deletions docs/reference/flow.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Classes that structure (hybrid) workflows.

.. automodule:: hybrid.flow


Classes
=======

Expand All @@ -19,6 +20,7 @@ Classes
.. autoclass:: Identity
.. autoclass:: BlockingIdentity
.. autoclass:: Lambda
.. autoclass:: Log
.. autoclass:: Loop
.. autoclass:: LoopUntilNoImprovement
.. autoclass:: LoopWhileNoImprovement
Expand Down
3 changes: 2 additions & 1 deletion docs/reference/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ Reference Documentation
:maxdepth: 2

core
flow
samplers
composers
decomposers
flow
utilities
profiling
conversion
traits
exceptions
Expand Down
35 changes: 35 additions & 0 deletions docs/reference/profiling.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
.. _profiling_hybrid:

=========
Profiling
=========

Workflow inspection and profiling utilities.

.. automodule:: hybrid.profiling


Decorators
==========

.. currentmodule:: hybrid.profiling

.. autosummary::
:toctree: generated/

make_count
make_timeit
tictoc
trace


Methods
=======

.. currentmodule:: hybrid.profiling

.. autosummary::
:toctree: generated/

print_structure
print_counters
21 changes: 18 additions & 3 deletions docs/reference/samplers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,33 @@ Samplers
Classes
=======

.. autoclass:: InterruptableTabuSampler
.. autoclass:: QPUSubproblemExternalEmbeddingSampler
QPU Samplers and Embedders
--------------------------

.. autoclass:: QPUSubproblemAutoEmbeddingSampler
.. autoclass:: RandomSubproblemSampler
.. autoclass:: QPUSubproblemExternalEmbeddingSampler
.. autoclass:: ReverseAnnealingAutoEmbeddingSampler
.. autoclass:: SubproblemCliqueEmbedder

Classical Samplers
------------------

.. autoclass:: RandomSubproblemSampler
.. autoclass:: SimulatedAnnealingProblemSampler
.. autoclass:: SimulatedAnnealingSubproblemSampler
.. autoclass:: SteepestDescentProblemSampler
.. autoclass:: SteepestDescentSubproblemSampler
.. autoclass:: TabuProblemSampler
.. autoclass:: TabuSubproblemSampler

Interruptable Variants
~~~~~~~~~~~~~~~~~~~~~~

.. autoclass:: InterruptableTabuSampler
.. autoclass:: InterruptableSimulatedAnnealingProblemSampler
.. autoclass:: InterruptableSimulatedAnnealingSubproblemSampler


.. _samplers-examples:

Examples
Expand Down
28 changes: 28 additions & 0 deletions docs/reference/utilities.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,18 @@ Utilities

.. automodule:: hybrid.utils


Decorators
==========

.. currentmodule:: hybrid.core

.. autosummary::
:toctree: generated/

stoppable


Methods
=======

Expand All @@ -14,11 +26,14 @@ Methods
.. autosummary::
:toctree: generated/

bqm_density
bqm_edges_between_variables
bqm_induced_by
bqm_reduced_to
chimera_tiles
cpu_count
flip_energy_gains
hstack_samplesets
max_sample
min_sample
random_sample
Expand All @@ -28,3 +43,16 @@ Methods
select_localsearch_adversaries
select_random_subgraph
updated_sample
vstack_samplesets


Classes
=======

.. currentmodule:: hybrid.utils

.. autosummary::
:toctree: generated/

NumpyEncoder
OceanEncoder
2 changes: 0 additions & 2 deletions hybrid/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import os
import operator
import logging
import threading
from collections import namedtuple, defaultdict
Expand Down
11 changes: 7 additions & 4 deletions hybrid/profiling.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import logging
import functools

__all__ = ['perf_counter', 'tictoc', 'print_structure', 'print_counters']
__all__ = ['perf_counter', 'tictoc', 'trace', 'print_structure', 'print_counters']

logger = logging.getLogger(__name__)

Expand All @@ -33,7 +33,8 @@
class tictoc(object):
"""Instrument and log function execution duration.

Examples:
Examples::

@tictoc('function', loglevel=logging.INFO)
def f(x, y):
a = x * y
Expand Down Expand Up @@ -101,7 +102,8 @@ class make_count(object):
Args:
counters (dict): Counters storage.

Example:
Example::

counters = {}
count = make_count(counters)

Expand Down Expand Up @@ -132,7 +134,8 @@ class make_timeit(object):
Args:
timers (dict): Timers storage.

Example:
Example::

timers = {}
timeit = make_timeit(timers)

Expand Down