Skip to content

Commit

Permalink
fixup! Refactor serialization handling by replacing SerialMixin with …
Browse files Browse the repository at this point in the history
…Serializable and adding a dedicated serialization module

Enhance unstructure hook for Benchmark class by integrating cattr's make_dict_unstructure_fn for covering recursive serialization of settings and exclude function
  • Loading branch information
fabianliebig committed Nov 24, 2024
1 parent 260ff6a commit e99f861
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion benchmarks/definition/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

from attrs import define, field
from attrs.validators import instance_of
from cattr.gen import make_dict_unstructure_fn, override
from pandas import DataFrame

from baybe.utils.random import temporary_seed
Expand Down Expand Up @@ -94,6 +95,9 @@ def __call__(self) -> Result:
converter.register_unstructure_hook(
Benchmark,
lambda o: dict(
{"description": o.description}, **converter.unstructure_attrs_asdict(o)
{"description": o.description},
**make_dict_unstructure_fn(Benchmark, converter, function=override(omit=True))(
o
),
),
)

0 comments on commit e99f861

Please sign in to comment.