Skip to content

factory⚓︎

Build a localization strategy from its config, by name.

The strategies are looked up in :data:LOCALIZATIONS, a table from the config's name to a builder. Adding a strategy is one call to :func:register_localization; nothing here needs editing.

available_localizations() ⚓︎

The registered localization names, sorted.

build_localization_instance(parsed_info, data_indices=None, data_types=None, parameters=None, ensemble_size=None, data=None, prior_info=None, rng=None) ⚓︎

Create the localization strategy the config names.

rng is the run's random stream, for strategies that draw (the auto-adaptive one shuffles the ensemble to estimate a noise level).

register_localization(name, builder, *, overwrite=False) ⚓︎

Make a localization strategy selectable as localization = {name = ...}.

Parameters:

Name Type Description Default
name str

The value of the config's name key.

required
builder callable

Called as builder(info=..., data_indices=..., data_types=..., parameters=..., ensemble_size=..., data=..., prior_info=..., rng=...); it may ignore what it does not need. Returns the strategy object, which the analyses use through its name attribute and by calling it.

required
overwrite bool

Allow replacing an existing entry. Off by default, so two packages claiming the same name is an error rather than a load-order lottery.

False