Skip to content

fix: improve AddonMemory deprecation error message with migration example#605

Merged
bvdmitri merged 6 commits into
ReactiveBayes:mainfrom
ArpanC6:main
May 18, 2026
Merged

fix: improve AddonMemory deprecation error message with migration example#605
bvdmitri merged 6 commits into
ReactiveBayes:mainfrom
ArpanC6:main

Conversation

@ArpanC6

@ArpanC6 ArpanC6 commented May 18, 2026

Copy link
Copy Markdown
Contributor

What

Made the AddonMemory deprecation error message in
src/annotations/input_arguments.jl easier to understand.

Now it shows:

A simple example of what to change before/after
A direct link to the v5-to-v6 migration guide

Why

Before, the error message was confusing and didn’t tell users what to do (like in RxInfer.jl issue #600).
Now it clearly shows what code to replace and where to find help.

Changes

src/annotations/input_arguments.jl: updated the error message

  1. Tests pass locally
  2. Code formatted
  3. CHANGELOG.md updated

@bvdmitri bvdmitri left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe also use the annotations as a variable name instead of addons

Comment thread src/annotations/input_arguments.jl Outdated
"""To migrate, replace:\n""" *
""" addons = (AddonMemory(),)\n""" *
"""with:\n""" *
""" addons = (InputArgumentsAnnotations(),)\n""" *

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
""" addons = (InputArgumentsAnnotations(),)\n""" *
""" annotations = (InputArgumentsAnnotations(),)\n""" *

@ArpanC6

ArpanC6 commented May 18, 2026

Copy link
Copy Markdown
Contributor Author

Hlw @bvdmitri I have improved the AddonMemory deprecation
error message to include a clear before/after migration
example and a direct link to the v5-to-v6 migration guide.

This should help users like in RxInfer.jl#600 who were
confused about how to migrate.

@ArpanC6

ArpanC6 commented May 18, 2026

Copy link
Copy Markdown
Contributor Author

@bvdmitri thanks for the review..

While working on this I noticed the error message
for AddonLogScale in the same file follows a
similar pattern should I improve that one too
for consistency? Alsoare there other deprecated functions in the
codebase that might benefit from similar migration
examples?

@bvdmitri

Copy link
Copy Markdown
Member

While working on this I noticed the error message
for AddonLogScale in the same file follows a
similar pattern should I improve that one too
for consistency?

Would be great!

Alsoare there other deprecated functions in the
codebase that might benefit from similar migration
examples?

Not that I immediately can remember :) I think we can focus this PR on AddonLogScale

Comment thread src/annotations/logscale.jl Outdated
"""and replaced by `LogScaleAnnotations`.\n""" *
"""\n""" *
"""To migrate, replace:\n""" *
""" annotations = (AddonLogScale(),)\n""" *

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is the opposite, previously we called it addons, so the variable in the old code is most likely to be called addons

Suggested change
""" annotations = (AddonLogScale(),)\n""" *
""" addons = (AddonLogScale(),)\n""" *

@ArpanC6

ArpanC6 commented May 18, 2026

Copy link
Copy Markdown
Contributor Author

Updated Used addons as the variable name in the AddonLogScale migration example for consistency with the old API.

@bvdmitri bvdmitri merged commit 18d745c into ReactiveBayes:main May 18, 2026
@bvdmitri

Copy link
Copy Markdown
Member

Thanks @ArpanC6 !

@ArpanC6

ArpanC6 commented May 18, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @ArpanC6 !

Welcome..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants