snowshu.core.samplings package

Submodules

snowshu.core.samplings.utils module

snowshu.core.samplings.utils.get_sampling_from_partial(partial: Union[dict, str]) → Type[BaseSampling]

Takes a sampling config dict and returns an instance of BaseSampling

This will accept either a string name of a sampling to invoke it with no params, or a dict to invoke with the params passed.

Parameters

partial – the portion of the configuration dict that creates the sampling.

Example

  • Invoking with a partial of "default" will return an instance of DefaultSampling with all default values.

  • Invoking with a partial of {"default": {"margin_of_error": 0.03}} will return an instance of DefaultSampling with margin_of_error set to 3%.

Returns

The configured DefaultSampling.

Module contents