Skip to content

Conversation

oscarbenjamin
Copy link
Collaborator

@oscarbenjamin oscarbenjamin commented Jun 21, 2022

The ccode, cxxcode and fcode modules were deprecated because their names
conflict with the functions defined within them leading to import
ambiguity. The change here removes the modules altogether because
testing the deprecated behaviour still leads to import ambiguity in the
test suite.

References to other Issues or PRs

Fixes #23533

Brief description of what is fixed or changed

Remove the ccode, fcode and cxxcode deprecated submodules and the tests for the deprecated functionality.

Other comments

Release Notes

  • printing
    • BREAKING CHANGE: The deprecated stub submodules sympy.printing.ccode, sympy.printing.cxxcode and sympy.printing.fcode have been removed. These modules were renamed to e.g. sympy.printing.c in SymPy 1.7 but deprecated stub modules were left behind to give a warning to anyone doing from sympy.printing.ccode import ccode that they should change their imports. Those deprecated stub modules are now removed. The reason for this change was because of ambiguity when writing from sympy.printing import ccode which might import the ccode submodule or the ccode function defined in the submodule. Even continuing to test these deprecated stub modules caused problems in the test suite precisely because of this ambiguity so the modules are now removed completely. The functions that used to be defined in these modules are still available as e.g. from sympy import ccode, cxxcode, fcode (as they have been since before 1.7).

@sympy-bot
Copy link

sympy-bot commented Jun 21, 2022

Hi, I am the SymPy bot (v167). I'm here to help you write a release notes entry. Please read the guide on how to write release notes.

Your release notes are in good order.

Here is what the release notes will look like:

  • printing
    • BREAKING CHANGE: The deprecated stub submodules sympy.printing.ccode, sympy.printing.cxxcode and sympy.printing.fcode have been removed. These modules were renamed to e.g. sympy.printing.c in SymPy 1.7 but deprecated stub modules were left behind to give a warning to anyone doing from sympy.printing.ccode import ccode that they should change their imports. Those deprecated stub modules are now removed. The reason for this change was because of ambiguity when writing from sympy.printing import ccode which might import the ccode submodule or the ccode function defined in the submodule. Even continuing to test these deprecated stub modules caused problems in the test suite precisely because of this ambiguity so the modules are now removed completely. The functions that used to be defined in these modules are still available as e.g. from sympy import ccode, cxxcode, fcode (as they have been since before 1.7). (#23660 by @oscarbenjamin)

This will be added to https://github.com/sympy/sympy/wiki/Release-Notes-for-1.11.

Click here to see the pull request description that was parsed.
The ccode, cxxcode and fcode modules were deprecated because their names
conflict with the functions defined within them leading to import
ambiguity. The change here removes the modules altogether because
testing the deprecated behaviour still leads to import ambiguity in the
test suite.

<!-- Your title above should be a short description of what
was changed. Do not include the issue number in the title. -->

#### References to other Issues or PRs
<!-- If this pull request fixes an issue, write "Fixes #NNNN" in that exact
format, e.g. "Fixes #1234" (see
https://tinyurl.com/auto-closing for more information). Also, please
write a comment on that issue linking back to this pull request once it is
open. -->

Fixes #23533

#### Brief description of what is fixed or changed

Remove the ccode, fcode and cxxcode deprecated submodules and the tests for the deprecated functionality.

#### Other comments


#### Release Notes

<!-- Write the release notes for this release below between the BEGIN and END
statements. The basic format is a bulleted list with the name of the subpackage
and the release note for this PR. For example:

* solvers
  * Added a new solver for logarithmic equations.

* functions
  * Fixed a bug with log of integers.

or if no release note(s) should be included use:

NO ENTRY

See https://github.com/sympy/sympy/wiki/Writing-Release-Notes for more
information on how to write release notes. The bot will check your release
notes automatically to see if they are formatted correctly. -->

<!-- BEGIN RELEASE NOTES -->
* printing
  * BREAKING CHANGE: The deprecated stub submodules `sympy.printing.ccode`, `sympy.printing.cxxcode` and `sympy.printing.fcode` have been removed. These modules were renamed to e.g. `sympy.printing.c` in SymPy 1.7 but deprecated stub modules were left behind to give a warning to anyone doing `from sympy.printing.ccode import ccode` that they should change their imports. Those deprecated stub modules are now removed. The reason for this change was because of ambiguity when writing `from sympy.printing import ccode` which might import the `ccode` submodule or the `ccode` function defined in the submodule. Even continuing to test these deprecated stub modules caused problems in the test suite precisely because of this ambiguity so the modules are now removed completely. The functions that used to be defined in these modules are still available as e.g. `from sympy import ccode, cxxcode, fcode` (as they have been since before 1.7).
<!-- END RELEASE NOTES -->

Update

The release notes on the wiki have been updated.

@sympy-bot
Copy link

sympy-bot commented Jun 21, 2022

🟠

Hi, I am the SymPy bot (v167). I've noticed that some of your commits add or delete files. Since this is sometimes done unintentionally, I wanted to alert you about it.

This is an experimental feature of SymPy Bot. If you have any feedback on it, please comment at sympy/sympy-bot#75.

The following commits delete files:

  • 5f60445:
    • sympy/printing/ccode.py
    • sympy/printing/cxxcode.py
    • sympy/printing/fcode.py

If these files were added/deleted on purpose, you can ignore this message.

@oscarbenjamin
Copy link
Collaborator Author

@asmeurer what should we do with the list of deprecations in this case?

https://docs.sympy.org/dev/explanation/active-deprecations.html

Do we just remove this entry? Or should there be another entry for things that are now removed or something?

The ccode, cxxcode and fcode modules were deprecated because their names
conflict with the functions defined within them leading to import
ambiguity. The change here removes the modules altogether because
testing the deprecated behaviour still leads to import ambiguity in the
test suite.
@github-actions
Copy link

github-actions bot commented Jun 21, 2022

Benchmark results from GitHub Actions

Lower numbers are good, higher numbers are bad. A ratio less than 1
means a speed up and greater than 1 means a slowdown. Green lines
beginning with + are slowdowns (the PR is slower then master or
master is slower than the previous release). Red lines beginning
with - are speedups.

Significantly changed benchmark results (PR vs master)

Significantly changed benchmark results (master vs previous release)

       before           after         ratio
     [77f1d79c]       [596257ec]
     <sympy-1.10.1^0>                 
+        93.3±5ms        179±0.9ms     1.92  sum.TimeSum.time_doit

Full benchmark results can be found as artifacts in GitHub Actions
(click on checks at the top of the PR).

@oscarbenjamin oscarbenjamin added this to the SymPy 1.11 milestone Jun 21, 2022
@oscarbenjamin oscarbenjamin merged commit 24afa46 into sympy:master Jun 22, 2022
@oscarbenjamin oscarbenjamin deleted the pr_ccode branch June 22, 2022 22:12
@asmeurer
Copy link
Member

I'd say just remove it from the active list once the deprecation is removed. For historic changes, there is the release notes.

@oscarbenjamin
Copy link
Collaborator Author

I'd say just remove it from the active list once the deprecation is removed. For historic changes, there is the release notes.

I meant to resolve that before merging. I'll open a new PR...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Two tests fail even for Python 3.9 while packaging for openSUSE
3 participants