-
-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
make_dataclass
for Pytree
#13
Comments
Playing a bit with it, I'm able to do this but I'm not sure this is the way to go: import dataclasses as dc
from simple_pytree import dataclass, Pytree, static_field
A = dc.make_dataclass('A',
[('x', int),
'y',
('z', int, static_field(default=5))],
)
@dataclass
class B(A, Pytree):
...
B(1, 2, 3) |
Hey @pablo2909, I think your approach is correct and should be supported. It currently doesn't work but I created #14 fix it. |
Fixed in |
Thank you for the super quick response and fix :) Could you please elaborate on what did not work and the fix you brought ? Because the MWE I posted was working for me. Thanks again ! This library is really super useful :) |
No problem! The resulting pytree was not making |
Hi,
Thank you for this super cool library.
I was wondering if there is something similar to
make_dataclass
fromdataclasses
here ? In my case it would be super useful to build some custom metrics based on a config file.Thanks again :)
The text was updated successfully, but these errors were encountered: