StepPerturbImageFactory
- class nrtk.impls.perturb_image_factory.generic.step.StepPerturbImageFactory(perturber: type[PerturbImage], theta_key: str, start: float, stop: float, step: float = 1.0, to_int: bool = True)
Simple PerturbImageFactory implementation to step through the given range of values.
Methods
from_configInstantiates a PerturbImageFactory from a configuration dictionary.
Returns the configuration of the factory instance.
get_default_configReturns the default configuration for the PerturbImageFactory.
get_implsDiscover and return a set of classes that implement the calling class.
is_usableCheck whether this class is available for use.
- __init__(perturber: type[PerturbImage], theta_key: str, start: float, stop: float, step: float = 1.0, to_int: bool = True) None
Initialize the factory to produce PerturbImage instances of the given type.
Initialize the factory to produce PerturbImage instances of the given type, varying the given
theta_keyparameter from start to stop with given step.- Parameters:
perturber – Python implementation type of the PerturbImage interface to produce.
theta_key – Perturber parameter to vary between instances.
start – Initial value of desired range (inclusive).
stop – Final value of desired range (exclusive).
step – Step value between instances.
to_int – Boolean variable determining whether the thetas are cast as ints or floats.
- Raises:
TypeError – Given a perturber instance instead of type.
- get_config() dict[str, Any]
Returns the configuration of the factory instance.
- Returns:
dict[str, Any]: Configuration dictionary containing the perturber type and theta_key.
- property thetas: Sequence[float] | Sequence[int]
Get the sequence of theta values this factory will iterate over.