sequince.steps.context
======================

.. py:module:: sequince.steps.context


Attributes
----------

.. autoapisummary::

   sequince.steps.context.LOG_PROPOSAL_OVERRIDE_KEY
   sequince.steps.context.EVALUATION_COUNTS_KEY
   sequince.steps.context.SMC_TRANSFORMATION_KEY
   sequince.steps.context.RESULT_HDF5_OMITTED_METADATA_KEYS


Classes
-------

.. autoapisummary::

   sequince.steps.context.StepContext


Module Contents
---------------

.. py:data:: LOG_PROPOSAL_OVERRIDE_KEY
   :value: 'log_proposal_override'


.. py:data:: EVALUATION_COUNTS_KEY
   :value: 'evaluation_counts'


.. py:data:: SMC_TRANSFORMATION_KEY
   :value: 'smc_transformation'


.. py:data:: RESULT_HDF5_OMITTED_METADATA_KEYS

.. py:class:: StepContext

   Runtime context passed to each SMC step.


   .. py:attribute:: t
      :type:  int


   .. py:attribute:: next_observation_index
      :type:  int
      :value: 0



   .. py:attribute:: observation
      :type:  Any
      :value: None



   .. py:attribute:: shared
      :type:  collections.abc.Mapping[str, Any]

      Dictionary for shared user-defined context across steps.

      Should not be modified by steps directly; use ``metadata`` for step-to-step communication instead.


   .. py:attribute:: metadata
      :type:  collections.abc.Mapping[str, Any]

      Dictionary for step metadata that can be used for communication between steps and callbacks.


   .. py:attribute:: evaluation_counts
      :type:  sequince.target.EvaluationCounts


   .. py:attribute:: stop_requested
      :type:  bool
      :value: False



   .. py:attribute:: stop_immediately
      :type:  bool
      :value: False



   .. py:property:: iteration
      :type: int


      Alias for ``t``.


   .. py:method:: with_metadata(**updates)

      Return a context with copy-on-write metadata updates.



   .. py:method:: without_metadata(*keys)

      Return a context without the named metadata entries.



   .. py:method:: add_evaluation_counts(counts)

      Return a context with newly incurred work added to its counters.



   .. py:method:: request_stop()

      Signal that the SMC runner should halt after this iteration.



   .. py:method:: request_stop_immediately()

      Signal that the SMC runner should halt immediately.



   .. py:method:: clear_stop_request()

      Clear any pending stop request.



