Skip to content

Base Schema

Base Schema¤

neojax.data.schemas.base_schema.BaseSchema ¤

Abstract base schema.

All custom schemas should inherit from BaseSchema.

transform(bundle_or_model_output: ~TIn, /, reference_bundle: neojax.data.bundles.data_bundle.DataBundle | None = None) -> ~TOut ¤

Transforms a data bundle into the needed model format.

Parameters:

Name Type Description Default
bundle_or_model_output ~TIn

If schema is an input schema, an instance of DataBundle, if schema is an output schema, any pytree the model outputs.

required
reference_bundle DataBundle | None

If schema is an output schema, the original input DataBundle to inherit geometries and unmodified fields from. Ignored for input schemas.

None

Returns:

Type Description
~TOut

If schema is an input schema, returns a raw array or pytree in model format. If schema is an output schema, returns a DataBundle instance.