-
Notifications
You must be signed in to change notification settings - Fork 78
Deprecate old serialization ((de)serialize_value_or_type) and add developer docs
#450
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
Deprecate old serialization ((de)serialize_value_or_type) and add developer docs
#450
Conversation
* add functools.wraps call to allow_kwargs decorator, as before it was breaking the autodoc functionality
* move content to separate pages * update section on serialization
pip install -U pip setuptools wheel leads to an error: https://github.com/bayesflow-org/bayesflow/actions/runs/14692655483/job/41230057180?pr=449
The functools.wrap decorator adds a frame object to the call stack
Codecov ReportAttention: Patch coverage is
|
|
I cannot get the PointInferenceNetwork to work with the new functions. @han-ol Do you have time to take a look at this? |
- add deprecation warning, remove functionality - replace all occurences with the corresponding new functions
161593c to
06e3352
Compare
|
Thanks for looking into this and glad that it worked out. With respect to serialization changes of I take it you also tried to address the awkwardness documented in https://github.com/bayesflow-org/bayesflow/blob/main/bayesflow/networks/point_inference_network.py#L80. Do you think we can make progress here before the upstream keras issue is resolved? In any case, this PR is ready to merge after @LarsKue takes a look. |
|
Thanks for your comments. Regarding your question: Yes, in my first attempt I tried to streamline it a bit, but it failed with error messages I could not learn a lot from, unfortunately. They might well be related to the issue, but I did not explore it further. As the new functions do a very similar thing as the old ones, my guess would be that we cannot resolve this yet. |
(de)serialize_value_or_type)(de)serialize_value_or_type) and add developer docs
LarsKue
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the PR and for the added docs!
The functionality was replaced by the more powerful
serializeanddeserializefunctions. Therefore I would suggest we deprecate the old functions.It was still use in the point estimation setting, this change would break loading of previously saved models that use those classes. I just noticed that the
serializableadapter is currently producing wrong packages (I will open and link an issue soon). I first thought that it was related to my changes, and already fixed it in a1b4d19. But the problem is also present ondevandmain.As the fix for this also breaks backwards compatibility, I think doing this deprecation now might be a good.
This PR is a continuation of #449 which also contains the fix, so the diff will simplify once #449 is merged (or we merge both jointly by merging this one).