nemora.synthesis

Nemora’s synthesis package is beginning with helper utilities that translate sampling bootstrap results into the DataFrame/metadata payloads that future stem and stand generators will consume. These helpers standardise how downstream modules access provenance (distribution, parameters, bins, tallies) alongside the sampled stems.

See also

Helper API

.. py:module:: nemora.synthesis.helpers

Bootstrap helpers for synthesis (forest/stand/tree) consumers.

.. py:class:: BootstrapPayload(frame, stacked, metadata) :module: nemora.synthesis.helpers

Bases: :py:class:object

Structured payload for synthesis bootstrap consumers.

.. py:attribute:: BootstrapPayload.frame :module: nemora.synthesis.helpers :type: ~pandas.DataFrame

.. py:attribute:: BootstrapPayload.metadata :module: nemora.synthesis.helpers :type: dict[str, object]

.. py:attribute:: BootstrapPayload.stacked :module: nemora.synthesis.helpers :type: ~numpy.ndarray

.. py:class:: StandDBHSampler(assignment, entry, *, sampling_config=None) :module: nemora.synthesis.helpers

Bases: :py:class:object

Sampler that draws DBH values for a single stand.

.. py:method:: StandDBHSampler.draw(*, rng=None, sample_size=None, resample=None) :module: nemora.synthesis.helpers

  Draw DBH values using the configured sampler.


  :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`\~numpy.ndarray\``

.. py:attribute:: StandDBHSampler.sampler_type :module: nemora.synthesis.helpers :type: ~typing.Literal[‘bootstrap’, ‘analytic’]

.. py:function:: bootstrap_payload(result) :module: nemora.synthesis.helpers

Return a structured payload with stacked samples + metadata.

:rtype: :sphinx_autodoc_typehints_type:\:py\:class\:\~nemora.synthesis.helpers.BootstrapPayload``

.. py:function:: bootstrap_to_dataframe(result, *, attach_metadata=True) :module: nemora.synthesis.helpers

Return a DataFrame view of a bootstrap result with optional metadata.

:rtype: :sphinx_autodoc_typehints_type:\:py\:class\:\~pandas.DataFrame``

.. py:function:: build_dbh_samplers(manifest, *, sampling_config=None) :module: nemora.synthesis.helpers

Construct DBH samplers for each stand assignment in a manifest.

:rtype: :sphinx_autodoc_typehints_type:\:py\:class\:\list`\ \[:py:class:`~nemora.synthesis.helpers.StandDBHSampler`]`