DeferredFactory#

class pymc_marketing.serialization.DeferredFactory(**data)[source]#

Serializable recipe for creating objects with non-serializable state.

Instead of storing a live object (e.g., a Prior with PyTensor tensor parameters), store the factory function path and its scalar arguments. Call resolve() at build_model() time to create the actual object.

Methods

DeferredFactory.__init__(**data)

Create a new model by parsing and validating input data from keyword arguments.

DeferredFactory.construct([_fields_set])

DeferredFactory.copy(*[, include, exclude, ...])

Returns a copy of the model.

DeferredFactory.dict(*[, include, exclude, ...])

DeferredFactory.from_dict(data)

Reconstruct a DeferredFactory from a dict.

DeferredFactory.from_orm(obj)

DeferredFactory.json(*[, include, exclude, ...])

DeferredFactory.model_parametrized_name(params)

Compute the class name for parametrizations of generic classes.

DeferredFactory.parse_file(path, *[, ...])

DeferredFactory.parse_obj(obj)

DeferredFactory.parse_raw(b, *[, ...])

DeferredFactory.resolve()

Import the factory function and call it with kwargs.

DeferredFactory.schema([by_alias, ref_template])

DeferredFactory.schema_json(*[, by_alias, ...])

DeferredFactory.to_dict()

Serialize the deferred factory to a dict.

DeferredFactory.update_forward_refs(**localns)

DeferredFactory.validate(value)

Attributes

model_computed_fields

model_config

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_extra

Get extra fields set during validation.

model_fields

model_fields_set

Returns the set of fields that have been explicitly set on this model instance.

factory

kwargs