You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
flytekit's dataclass transformer requires JSON-serializable dataclasses (docs). Currently, we construct JSON-serializable dataclasses for arguments or whole function interfaces along the lines of the pseudocode
fromdatclassesimportmake_dataclassfromdataclasses_jsonimportDataClassJsonMixin# OR# from mashumaro.mixins.json import DataClassJSONMixinfromhydra_zenimportbuildsfromsklearn.linear_modelimportLogisticRegression# ...# passing DataClassJsonMixin to bases via make_dataclasslogistic_regression_fields=create_dataclass_from_callable(
LogisticRegression, custom_types_defaults
)
LRI_DataClass=make_dataclass(
"LRI_DataClass",
logistic_regression_fields,
bases=(DataClassJsonMixin,),
)
LRI_DataClass.__module__=__name__
Not at all! Thank you for chiming in. I would have posted this in a discussion on the hydra-zen repository, but had not yet invested enough time to understand what I was missing, so I logged it here for future work.
I think you can make inheritable via builds by making a dataclass-typed subclass of it
flytekit's dataclass transformer requires JSON-serializable dataclasses (docs). Currently, we construct JSON-serializable dataclasses for arguments or whole function interfaces along the lines of the pseudocode
approximating the usage in the logistic regression example, which, accounting for the dependency on
flytezen/src/flytezen/configuration.py
Lines 36 to 117 in 526203d
create_dataclass_from_callable
, is verbose, even though it behaves as expected.Based on the documentation for hydra_zen.builds zen_dataclass argument it seems like it should be possible to use the dataclasses constructed by hydra-zen instead
and eliminate
create_dataclass_from_callable
from flytezen altogether, but this producesThe text was updated successfully, but these errors were encountered: