Skip to content

Remove old deprecated code#1050

Merged
ThomSerg merged 3 commits into
masterfrom
remove_deprecations
Jul 17, 2026
Merged

Remove old deprecated code#1050
ThomSerg merged 3 commits into
masterfrom
remove_deprecations

Conversation

@ThomSerg

Copy link
Copy Markdown
Collaborator

Removing old code that has been deprecated for a while. Some are still left in place due to

  • being deprecated just now for the 1.0 release
  • being deprecated for longer, but not correctly being labeled as such. Here we still need to give users time to make the switch.

Partially solves #1048. The removed code will be documented in the changelog of v1.0.0 and in the docs #1038

@ThomSerg ThomSerg mentioned this pull request Jul 15, 2026
15 tasks

@IgnaceBleukx IgnaceBleukx left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Nice cleanup, I would keep the deprecated args to the transformation functions for a next release, we haven't had a release yet where the user was warned about them with a proper error message?

:func:`cpmpy.transformations.reification.reify_rewrite`
E.g. ``bv -> NumExpr <comp> Var/Const`` will then be rewritten as ``[bv -> IV0 <comp> Var/Const, NumExpr == IV0]``.
"""
assert _toplevel is None, "decompose_in_tree: argument '_toplevel' is deprecated, do not use/modify it"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

For this one I'm not sure, we have not had a release yet where it is deprecated, so maybe wait one more?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I added the arguments back, but with a warning instead of an assert (since the latter would be an equal sudden breaking change to removing the argument)



def no_partial_functions(lst_of_expr: list[Expression],
_toplevel: Optional[Any]=None,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Same here, we haven't had a release yet where this had a warning

@ThomSerg ThomSerg added this to the v0.20 milestone Jul 16, 2026
@OrestisLomis

Copy link
Copy Markdown
Contributor

Are many of the examples not broken now? I should resume my clean up of those..

@IgnaceBleukx

Copy link
Copy Markdown
Collaborator

I can confirm all examples run, so should be good to merge? (also very nicely documented in the changelog btw : ) )

@ThomSerg
ThomSerg merged commit a88d0d4 into master Jul 17, 2026
12 checks passed
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.

3 participants