Transforms¶
Parameter transform schemas (log, log10, exp, negate, inverse, pow10, identity).
Schemas for transforms.
- class ionworks.pipeline.transforms.Exp(parameter)[source]¶
Bases:
TransformExponential transform.
Transforms a parameter by taking e raised to the power of the parameter value.
Notes
The transform is monotonic
- model_config = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True, 'validate_assignment': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class ionworks.pipeline.transforms.Identity(parameter)[source]¶
Bases:
TransformIdentity transform.
A transform that returns the input unchanged. Useful as a placeholder or for testing.
Notes
The transform is monotonic
- model_config = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True, 'validate_assignment': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class ionworks.pipeline.transforms.Inverse(parameter)[source]¶
Bases:
TransformInverse (1/x) transform.
Transforms a parameter by taking its reciprocal (1/x). Cannot be used with zero values.
Notes
The transform is not monotonic
Input values cannot be zero
- model_config = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True, 'validate_assignment': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class ionworks.pipeline.transforms.Log(parameter)[source]¶
Bases:
TransformNatural logarithm transform.
Transforms a parameter by taking its natural logarithm. Only works with positive values.
Notes
The transform is monotonic
Input values must be positive
- model_config = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True, 'validate_assignment': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class ionworks.pipeline.transforms.Log10(parameter)[source]¶
Bases:
TransformLogarithm base 10 transform.
Transforms a parameter by taking its base-10 logarithm. Only works with positive values.
Notes
The transform is monotonic
Input values must be positive
- model_config = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True, 'validate_assignment': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class ionworks.pipeline.transforms.Negate(parameter)[source]¶
Bases:
TransformNegate transform.
Transforms a parameter by negating its value (-x).
Notes
The transform is not monotonic
- model_config = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True, 'validate_assignment': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class ionworks.pipeline.transforms.Pow10(parameter)[source]¶
Bases:
TransformPower of 10 transform.
Transforms a parameter by raising 10 to the power of the parameter value.
Notes
The transform is monotonic
- model_config = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True, 'validate_assignment': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class ionworks.pipeline.transforms.Transform(parameter)[source]¶
Bases:
BaseSchemaBase class for parameter transformations.
Concrete transforms (
Exp,Identity,Inverse,Log,Log10,Negate,Pow10) inherit from this base, so anywhere the schema needs to type “a parameter transform” the type isTransform.Transforms move parameters between different spaces (e.g. log space, exponential space) while maintaining the parameter bounds and initial values, and can be chained together.
- parameter: Annotated[dict[str, Any] | BaseSchema | Any, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])]¶
- to_config() dict[source]¶
Build the dict you submit through
ionworks.api.The output is the inner parameter’s config with a
"transform"key naming this transform ("Log","Exp", …). Chained transforms collapse into a single dict carrying the outermost transform name plus the underlying parameter’s bounds and initial value.
- model_config = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True, 'validate_assignment': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].