reflectometry / refl1d

1-D reflectometry fitting
https://refl1d.readthedocs.io/
Other
17 stars 23 forks source link

Serialize stdlib dataclasses #166

Closed bmaranville closed 9 months ago

bmaranville commented 9 months ago

I don't think we need a custom schema decorator. We added keyword arguments "exclude" and "include" to the schema decorator, but they never ended up getting used, and there are other ways to solve that problem if it ever comes up.

Also, at some point stdlib dataclasses started supporting descriptor-based attributes. This removed the need for the complicated structure like

@schema(classname="Parameter")
class ParameterSchema:
    ...

class Parameter(ParameterSchema):
    ...

Need to check when that happened, to ensure compatibility.