Repository navigation
v0.3.0
This is a relatively massive release bringing lots of new features and bugfixes. All users are encouraged to upgrade. The full changelog can be viewed in the documentation website. The highlights include:
Breaking changes:
- The minimum supported version of Python is now 3.7 (up from 3.6).
- Moved transform implementations from
formulaic.materializers.transformsto
the top-levelformulaic.transformsmodule, and ported all existing
transforms to outputFactorValuestypes rather than dictionaries.
FactorValuesis an object proxy that allows output types like
pandas.DataFrames to be used as they normally would, with some additional
metadata for formulaic accessible via the__formulaic_metadata__
attribute. This makes non-formula direct usage of these transforms much more
pleasant. ~is no longer a generic formula separator, and can only be used once in a
formula. Please use the newly added|operator to separate a formula into
multiple parts.
New features and enhancements:
- Added support for "structured" formulas, and updated the
~operator to use
them. Structured formulas can have named substructures, for example:lhs
andrhsfor the~operator. The representation of formulas has been
updated to show this structure. - Added support for context-sensitivity during the resolution of operators,
allowing more flexible operators to be implemented (this is exploited by the
|operator which splits formulas into multiple parts). - The
formulaic.model_matrixsyntactic sugar function now acceptsModelSpec
andModelMatrixinstances as the "formula" spec, making generation of
matrices with the same form as previously generated matrices more
convenient. - Added the
polytransform (compatible with R and patsy). numpyis now always available in formulas vianp, allowing formulas like
np.sum(x). For convenience,log,log10,log2,exp,exp10and
exp2are now exposed as transforms independent of user context.- Pickleability is now guaranteed and tested via unit tests. Failure to pickle
any formulaic metadata object (such as formulas, model specs, etc) is
considered a bug. - The capturing of user context for use in formula materialization has been
split out into a utility methodformulaic.utils.context.capture_context().
This can be used by libraries that wrap Formulaic to capture the variables
and/or transforms available in a users' environment where appropriate.