Skip to content

Commit 8110dc5

Browse files
author
Release Manager
committed
gh-37312: `sage.plot.animate`: Use FFmpeg.absolute_filename; `sage.features`: Remove deprecated methods <!-- ^^^^^ Please provide a concise, informative and self-explanatory title. Don't put issue numbers in there, do this in the PR body below. For example, instead of "Fixes #1234" use "Introduce new method to calculate 1+1" --> <!-- Describe your changes here in detail --> <!-- Why is this change required? What problem does it solve? --> <!-- If this PR resolves an open issue, please link to it here. For example "Fixes #12345". --> - Fixes #35255 Removes methods deprecated in: - #31292 (2022) - #33114 (2022) <!-- If your change requires a documentation PR, please link it appropriately. --> ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> <!-- If your change requires a documentation PR, please link it appropriately --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> <!-- Feel free to remove irrelevant items. --> - [x] The title is concise, informative, and self-explanatory. - [ ] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation accordingly. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on - #12345: short description why this is a dependency - #34567: ... --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> URL: #37312 Reported by: Matthias Köppe Reviewer(s): Kwankyu Lee
2 parents e69245c + 6b7cf25 commit 8110dc5

File tree

3 files changed

+5
-60
lines changed

3 files changed

+5
-60
lines changed

src/sage/features/__init__.py

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,7 @@ class FileFeature(Feature):
606606
To work with the file described by the feature, use the method :meth:`absolute_filename`.
607607
A :class:`FeatureNotPresentError` is raised if the file cannot be found::
608608
609-
sage: Executable(name="does-not-exist", executable="does-not-exist-xxxxyxyyxyy").absolute_path()
609+
sage: Executable(name="does-not-exist", executable="does-not-exist-xxxxyxyyxyy").absolute_filename()
610610
Traceback (most recent call last):
611611
...
612612
sage.features.FeatureNotPresentError: does-not-exist is not available.
@@ -654,32 +654,6 @@ def absolute_filename(self) -> str:
654654
# the distribution sagemath-environment.
655655
raise NotImplementedError
656656

657-
def absolute_path(self):
658-
r"""
659-
Deprecated alias for :meth:`absolute_filename`.
660-
661-
Deprecated to make way for a method of this name returning a ``Path``.
662-
663-
EXAMPLES::
664-
665-
sage: from sage.features import Executable
666-
sage: Executable(name="sh", executable="sh").absolute_path()
667-
doctest:warning...
668-
DeprecationWarning: method absolute_path has been replaced by absolute_filename
669-
See https://github.com/sagemath/sage/issues/31292 for details.
670-
'/...bin/sh'
671-
"""
672-
try:
673-
from sage.misc.superseded import deprecation
674-
except ImportError:
675-
# The import can fail because sage.misc.superseded is provided by
676-
# the distribution sagemath-objects, which is not an
677-
# install-requires of the distribution sagemath-environment.
678-
pass
679-
else:
680-
deprecation(31292, 'method absolute_path has been replaced by absolute_filename')
681-
return self.absolute_filename()
682-
683657

684658
class Executable(FileFeature):
685659
r"""
@@ -764,7 +738,7 @@ def absolute_filename(self) -> str:
764738
765739
A :class:`FeatureNotPresentError` is raised if the file cannot be found::
766740
767-
sage: Executable(name="does-not-exist", executable="does-not-exist-xxxxyxyyxyy").absolute_path()
741+
sage: Executable(name="does-not-exist", executable="does-not-exist-xxxxyxyyxyy").absolute_filename()
768742
Traceback (most recent call last):
769743
...
770744
sage.features.FeatureNotPresentError: does-not-exist is not available.

src/sage/features/join_feature.py

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -98,36 +98,6 @@ def _is_present(self):
9898
return test
9999
return FeatureTestResult(self, True)
100100

101-
def is_functional(self):
102-
r"""
103-
Test whether the join feature is functional.
104-
105-
This method is deprecated. Use :meth:`Feature.is_present` instead.
106-
107-
EXAMPLES::
108-
109-
sage: from sage.features.latte import Latte
110-
sage: Latte().is_functional() # optional - latte_int
111-
doctest:warning...
112-
DeprecationWarning: method JoinFeature.is_functional; use is_present instead
113-
See https://github.com/sagemath/sage/issues/33114 for details.
114-
FeatureTestResult('latte_int', True)
115-
"""
116-
try:
117-
from sage.misc.superseded import deprecation
118-
except ImportError:
119-
# The import can fail because sage.misc.superseded is provided by
120-
# the distribution sagemath-objects, which is not an
121-
# install-requires of the distribution sagemath-environment.
122-
pass
123-
else:
124-
deprecation(33114, 'method JoinFeature.is_functional; use is_present instead')
125-
for f in self._features:
126-
test = f.is_functional()
127-
if not test:
128-
return test
129-
return FeatureTestResult(self, True)
130-
131101
def hide(self):
132102
r"""
133103
Hide this feature and all its joined features.

src/sage/plot/animate.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1023,8 +1023,9 @@ def ffmpeg(self, savefile=None, show_path=False, output_format=None,
10231023
# afterwards. Hence 'early_options' and 'ffmpeg_options'
10241024
# The `-nostdin` is needed to avoid the command to hang, see
10251025
# https://stackoverflow.com/questions/16523746/ffmpeg-hangs-when-run-in-background
1026-
cmd = 'cd {}; ffmpeg -nostdin -y -f image2 {} -i {} {} {}'.format(
1027-
shlex.quote(pngdir), early_options, shlex.quote(pngs), ffmpeg_options, shlex.quote(savefile))
1026+
cmd = 'cd {}; {} -nostdin -y -f image2 {} -i {} {} {}'.format(
1027+
shlex.quote(pngdir), shlex.quote(FFmpeg().absolute_filename()),
1028+
early_options, shlex.quote(pngs), ffmpeg_options, shlex.quote(savefile))
10281029
from subprocess import check_call, CalledProcessError, PIPE
10291030
try:
10301031
if sage.misc.verbose.get_verbose() > 0:

0 commit comments

Comments
 (0)