Skip to content
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

SymPy Deprecation backlog #22892

Closed
ThePauliPrinciple opened this issue Jan 20, 2022 · 7 comments
Closed

SymPy Deprecation backlog #22892

ThePauliPrinciple opened this issue Jan 20, 2022 · 7 comments
Labels
Uncategorised Doesn't fit other labels...

Comments

@ThePauliPrinciple
Copy link
Contributor

There is a bunch of code that has been deprecated for a long time. Maybe it is a good idea to set a "hard cut-off" for deprecated code e.g. "everything deprecated in version 1.5 or earlier gets removed"?

Or is it prefered to keep it in the codebase until it is actively interfering with development?

Or is the reason it is not removed because it is difficult to actually remove these pieces of code?

git grep "deprecated_since_version="
sympy/assumptions/ask.py:        deprecated_since_version="1.8"
sympy/assumptions/ask.py:        deprecated_since_version="1.8"
sympy/assumptions/assume.py:            deprecated_since_version="1.8"
sympy/assumptions/assume.py:            deprecated_since_version="1.8"
sympy/assumptions/assume.py:            deprecated_since_version="1.8"
sympy/assumptions/handlers/common.py:            deprecated_since_version="1.8"
sympy/calculus/finite_diff.py:    deprecated_since_version="1.1", issue=11410)(_as_finite_diff)
sympy/calculus/finite_diff.py:                                deprecated_since_version="1.5").warn()
sympy/codegen/array_utils.py:    deprecated_since_version="1.8"
sympy/concrete/expr_with_limits.py:                deprecated_since_version=1.6,
sympy/core/basic.py:                                deprecated_since_version="1.9").warn()
sympy/core/basic.py:    deprecated_since_version="1.10", issue=22288)(_preorder_traversal)
sympy/core/compatibility.py:    deprecated_since_version="1.10", issue=22352)(_default_sort_key)
sympy/core/compatibility.py:    deprecated_since_version="1.10", issue=22352)(_ordered)
sympy/core/compatibility.py:    deprecated_since_version="1.10", issue=22352)(__nodes)
sympy/core/compatibility.py:    deprecated_since_version="1.10", issue=22352)(_as_int)
sympy/core/compatibility.py:    deprecated_since_version="1.10", issue=22352)(_is_sequence)
sympy/core/compatibility.py:    deprecated_since_version="1.10", issue=22352)(_iterable)
sympy/core/compatibility.py:    deprecated_since_version="1.10", issue=22352)(_notiterable)
sympy/core/expr.py:                                deprecated_since_version="1.9").warn()
sympy/core/expr.py:                                deprecated_since_version="1.9").warn()
sympy/core/function.py:                deprecated_since_version="1.5").warn()
sympy/core/function.py:                                deprecated_since_version="1.9").warn()
sympy/core/numbers.py:                            deprecated_since_version="1.1").warn()
sympy/core/operations.py:                    deprecated_since_version="1.7"
sympy/core/power.py:                deprecated_since_version="1.7"
sympy/core/relational.py:                deprecated_since_version="1.5"
sympy/core/sympify.py:            deprecated_since_version='1.6'
sympy/core/trace.py:    deprecated_since_version="1.10", issue=22330)
sympy/diffgeom/diffgeom.py:                    deprecated_since_version="1.7"
sympy/diffgeom/diffgeom.py:                        deprecated_since_version="1.7"
sympy/diffgeom/diffgeom.py:            deprecated_since_version="1.7"
sympy/diffgeom/diffgeom.py:            deprecated_since_version="1.7"
sympy/diffgeom/diffgeom.py:                    deprecated_since_version=self.version).warn()
sympy/functions/special/delta_functions.py:    @deprecated(useinstead="expand(diracdelta=True, wrt=x)", issue=12859, deprecated_since_version="1.1")
sympy/geometry/line.py:    @deprecated(useinstead="equals", issue=12860, deprecated_since_version="1.0")
sympy/geometry/line.py:                deprecated_since_version="1.2").warn()
sympy/integrals/integrals.py:                deprecated_since_version="1.6",
sympy/integrals/integrals.py:                deprecated_since_version="1.6",
sympy/integrals/transforms.py:                deprecated_since_version="1.9"
sympy/matrices/common.py:                deprecated_since_version="1.4"
sympy/matrices/dense.py:            deprecated_since_version="1.9").warn()
sympy/matrices/densearith.py:    deprecated_since_version="1.1").warn()
sympy/matrices/densesolve.py:    deprecated_since_version="1.1").warn()
sympy/matrices/densetools.py:    deprecated_since_version="1.1").warn()
sympy/matrices/eigen.py:            deprecated_since_version=1.4,
sympy/matrices/eigen.py:            deprecated_since_version=1.4,
sympy/matrices/matrices.py:                deprecated_since_version="1.2",
sympy/matrices/matrices.py:    deprecated_since_version="1.3")
sympy/matrices/matrices.py:    deprecated_since_version="1.3",
sympy/matrices/repmatrix.py:                deprecated_since_version="1.9"
sympy/matrices/repmatrix.py:                deprecated_since_version="1.9"
sympy/matrices/sparse.py:            deprecated_since_version="1.9").warn()
sympy/physics/matrices.py:            deprecated_since_version="1.9")
sympy/physics/mechanics/particle.py:                deprecated_since_version="1.5", issue=9800).warn()
sympy/physics/mechanics/rigidbody.py:                deprecated_since_version="1.5", issue=9800).warn()
sympy/physics/units/dimensions.py:            deprecated_since_version="1.2",
sympy/physics/units/dimensions.py:            deprecated_since_version="1.2",
sympy/physics/units/dimensions.py:                deprecated_since_version="1.2",
sympy/physics/units/dimensions.py:                deprecated_since_version="1.2",
sympy/physics/units/dimensions.py:            deprecated_since_version="1.2",
sympy/physics/units/dimensions.py:            deprecated_since_version="1.2",
sympy/physics/units/dimensions.py:            deprecated_since_version="1.2",
sympy/physics/units/quantities.py:                deprecated_since_version="1.3",
sympy/physics/units/quantities.py:                deprecated_since_version="1.3",
sympy/physics/units/quantities.py:            deprecated_since_version="1.5",
sympy/physics/units/quantities.py:            deprecated_since_version="1.5",
sympy/physics/units/quantities.py:            deprecated_since_version="1.5",
sympy/physics/units/quantities.py:            deprecated_since_version="1.5",
sympy/physics/units/unitsystem.py:            deprecated_since_version="1.2",
sympy/plotting/plot.py:                deprecated_since_version="1.9",
sympy/polys/domains/domain.py:    @deprecated(useinstead="is_Field", issue=12723, deprecated_since_version="1.1")
sympy/polys/domains/domain.py:    @deprecated(useinstead="is_Ring", issue=12723, deprecated_since_version="1.1")
sympy/polys/multivariate_resultants.py:                        deprecated_since_version="1.5").warn()
sympy/polys/multivariate_resultants.py:                        deprecated_since_version="1.5").warn()
sympy/polys/polytools.py:                        deprecated_since_version="1.6",
sympy/polys/solvers.py:            deprecated_since_version="1.9"
sympy/printing/ccode.py:    deprecated_since_version="1.7").warn()
sympy/printing/cxxcode.py:    deprecated_since_version="1.7").warn()
sympy/printing/fcode.py:    deprecated_since_version="1.7").warn()
sympy/printing/latex.py:                deprecated_since_version="1.6").warn()
sympy/printing/pretty/pretty.py:                deprecated_since_version="1.6").warn()
sympy/printing/pretty/pretty_symbology.py:        deprecated_since_version="1.7").warn()
sympy/printing/pretty/stringpict.py:                deprecated_since_version="1.7").warn()
sympy/printing/pretty/stringpict.py:            deprecated_since_version="1.7").warn()
sympy/printing/repr.py:                deprecated_since_version="1.6").warn()
sympy/printing/str.py:                deprecated_since_version="1.6").warn()
sympy/printing/theanocode.py:        deprecated_since_version="1.8").warn()
sympy/printing/theanocode.py:        deprecated_since_version="1.8").warn()
sympy/sets/conditionset.py:                deprecated_since_version='1.5',
sympy/sets/sets.py:            issue=16946, deprecated_since_version="1.5")
sympy/sets/sets.py:                deprecated_since_version="1.5"
sympy/sets/sets.py:            issue=16946, deprecated_since_version="1.5")
sympy/simplify/simplify.py:    deprecated_since_version="1.10", issue=22288)(_bottom_up)
sympy/simplify/simplify.py:    deprecated_since_version="1.10", issue=22288)(_walk)
sympy/simplify/traversaltools.py:    deprecated_since_version="1.10", issue=22288)(_use)
sympy/stats/rv.py:                 deprecated_since_version="1.9",
sympy/stats/stochastic_process_types.py:            deprecated_since_version="1.7.1"
sympy/stats/stochastic_process_types.py:            deprecated_since_version="1.7"
sympy/tensor/indexed.py:                                deprecated_since_version="1.9").warn()
sympy/tensor/tensor.py:@deprecated(useinstead=".replace_with_arrays", issue=15276, deprecated_since_version="1.4")
sympy/tensor/tensor.py:            deprecated_since_version="1.5")
sympy/tensor/tensor.py:            deprecated_since_version="1.5")
sympy/tensor/tensor.py:                                    deprecated_since_version="1.5").warn()
sympy/tensor/tensor.py:                                    deprecated_since_version="1.5").warn()
sympy/tensor/tensor.py:                deprecated_since_version="1.5")
sympy/tensor/tensor.py:                deprecated_since_version="1.5")
sympy/tensor/tensor.py:            deprecated_since_version="1.5")
sympy/tensor/tensor.py:            issue=17108, deprecated_since_version="1.5")
sympy/testing/pytest.py:    ...         deprecated_since_version="1.0", issue=123).warn()
sympy/testing/randtest.py:    deprecated_since_version="1.10", issue=22433)(A)
sympy/testing/randtest.py:    deprecated_since_version="1.10", issue=22433)(B)
sympy/testing/randtest.py:    deprecated_since_version="1.10", issue=22433)(C)
sympy/testing/randtest.py:    deprecated_since_version="1.10", issue=22433)(D)
sympy/testing/randtest.py:    deprecated_since_version="1.10", issue=22433)(E)
sympy/testing/tests/test_pytest.py:            deprecated_since_version="0.0.0").warn()
sympy/utilities/benchmarking.py:    deprecated_since_version="1.6").warn()
sympy/utilities/exceptions.py:    ...     issue=1065, deprecated_since_version="1.0")) #doctest:+SKIP
sympy/utilities/exceptions.py:    ... issue=1065, deprecated_since_version="1.1").warn() #doctest:+SKIP
sympy/utilities/exceptions.py:    ...    deprecated_since_version="1.1")
sympy/utilities/exceptions.py:    ...    deprecated_since_version="0.7.2",
sympy/utilities/exceptions.py:    ...     deprecated_since_version="1.1")
sympy/utilities/exceptions.py:    ...     deprecated_since_version="1.1")
sympy/utilities/exceptions.py:    ...     deprecated_since_version="1.1")
sympy/utilities/exceptions.py:    ...     deprecated_since_version="1.1")
sympy/utilities/exceptions.py:                 useinstead=None, issue=None, deprecated_since_version=None):
sympy/utilities/iterables.py:    deprecated_since_version="1.10", issue=22288)
sympy/utilities/iterables.py:            issue=22288, deprecated_since_version="1.10")
sympy/utilities/lambdify.py:                    deprecated_since_version="1.6.3"
sympy/utilities/misc.py:                            deprecated_since_version="1.7").warn()
sympy/utilities/pytest.py:    deprecated_since_version="1.6").warn()
sympy/utilities/randtest.py:    deprecated_since_version="1.6").warn()
sympy/utilities/runtests.py:    deprecated_since_version="1.6").warn()
sympy/utilities/source.py:@deprecated(useinstead="?? in IPython/Jupyter or inspect.getsource", issue=14905, deprecated_since_version="1.3")
sympy/utilities/tests/test_pickling.py:    w = SymPyDeprecationWarning('value', 'feature', issue=12345, deprecated_since_version='1.0')
sympy/utilities/tmpfiles.py:    deprecated_since_version="1.6").warn()
sympy/vector/coordsysrect.py:        deprecated_since_version="1.1"
sympy/vector/coordsysrect.py:            deprecated_since_version="1.1",
sympy/vector/deloperator.py:                deprecated_since_version="1.1",
sympy/vector/operators.py:            deprecated_since_version="1.1",
@moorepants
Copy link
Member

My guess would be that no one gets back to it until it actually bothers someone. I've mentioned this elsewhere before, but the duration that something is in the deprecated state should be tied to real time, so like 1 year not 2 minor version bumps. I don't think PRs that remove deprecated features that are >1 year in that state will meet any resistance :) Some are a bit tricky to remove though.

@oscarbenjamin
Copy link
Collaborator

It's not hard to remove these things. The purpose of deprecation is twofold:

  1. It stops something from being used in SymPy (CI fails on a deprecation warning).
  2. It gives a warning message to downstream users and gives time for them to adjust their code if necessary.

Sometimes though there isn't any urgent need to remove something after it is deprecated. The deprecation warning ensures that it isn't used within SymPy and therefore isn't a hindrance to improvements elsewhere in the codebase. Direct downstream use may or may not break over time but usually there is some test that the deprecated functionality continues to work in a basic way (while issuing a warning). From a practical perspective this might mean that the original problem is effectively solved and hopefully that downstream code didn't break but might now see a warning.

The removal of things that are deprecated happens later just because either a need arises or someone decides to clean up the code. At least within sympy that "cleanup" is treated like many other possible cleanups that could be done at any time once someone has the time and inclination to do it.

A priori I don't see any reason why deprecated things should be removed quickly. Probably the reverse is true: it's kindest to downstream to leave the deprecation warning there for as long as possible so if there is no cost then why not just leave it?

@asmeurer
Copy link
Member

I would love to clean up our deprecation policy https://github.com/sympy/sympy/wiki/Deprecating-policy. Ideally it should be a SymPEP (https://github.com/sympy/sympeps), but those are still something that we haven't fleshed out fully yet sympy/SymPEPs#2.

I would also like to

  • Make a more definite policy on the length of deprecation periods. I agree it should be time based instead of release based.
  • Remove the "deprecation removal issue" thing. It's too confusing. We should instead put all information about a deprecation in the documentation, ideally using a combination of deprecation notes in respective docstrings, and a single page listing all active deprecations.

I think the general stuff on that page about what and why things should be deprecated is solid, but if there's anything about it you don't like, we should improve it as well.

This has been discussed in #20015.

It stops something from being used in SymPy (CI fails on a deprecation warning).

It's worth noting that we can also use normal (non-deprecation) warnings. That's more appropriate if there isn't always replacement functionality, or if it's something we might not actually remove (an example of this might be validation of assumptions passed into Symbol #21417).

There are also ways that we can disallow things in library code without deprecating them for users, for instance, by analyzing the call stack to see if the caller is user code or library code, or by having a "hidden" warning that is only turned on in the SymPy test suite.

For example, we could use one of these techniques to disallow string inputs in library code today #11003, without worrying about deprecating it for user code.

@asmeurer
Copy link
Member

Another thing I mentioned in that issue that I like is that we should write much longer descriptions in the warning messages themselves. Ideally the message should be enough for most users to know how to fix their code, without having to go to the documentation link. The documentation can be more about the "why" a deprecation was done, as well as giving longer examples.

@oscargus
Copy link
Contributor

I have independently of this (didn't find it until now) removed most of the 1.3 and earlier deprecations in #22949 and #22952

There are three additional deprecations in diffgeom that do not have a deprecated_since_version string, but one should be able to find them when they should be removed (1.7).

@oscargus
Copy link
Contributor

And, yes, it is not always that straightforward to remove them, at least not without understanding the code (which is the reason I did not remove all of them).

@ThePauliPrinciple
Copy link
Contributor Author

Since #22900 is now merged, eventhough this issue isn't solved entirely, at least it is currently being managed, so I am closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Uncategorised Doesn't fit other labels...
Projects
None yet
Development

No branches or pull requests

5 participants