Skip to content

Commit d172626

Browse files
authored
Remove deprecated File alias for VTKFile (#4756)
1 parent 347d198 commit d172626

File tree

2 files changed

+2
-29
lines changed

2 files changed

+2
-29
lines changed

firedrake/__init__.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ def init_petsc():
7575
from firedrake.mg.opencascade_mh import *
7676
from firedrake.norms import *
7777
from firedrake.nullspace import *
78+
from firedrake.output import *
7879
from firedrake.parameters import *
7980
from firedrake.parloops import *
8081
from firedrake.projection import *
@@ -96,11 +97,7 @@ def init_petsc():
9697
set_log_handlers(comm=COMM_WORLD)
9798

9899
# Moved functionality
99-
from firedrake._deprecation import plot, File # noqa: F401
100-
# Once `File` is deprecated update the above line removing `File` and add
101-
# from firedrake._deprecation import output
102-
# sys.modules["firedrake.output"] = output
103-
from firedrake.output import *
100+
from firedrake._deprecation import plot # noqa: F401
104101
import sys
105102
sys.modules["firedrake.plot"] = plot
106103
from firedrake.plot import *

firedrake/_deprecation.py

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
"""
33
import importlib
44

5-
from warnings import warn
6-
75

86
class _fake_module:
97
""" Object which behaves like a module
@@ -47,28 +45,6 @@ def __call__(*args, **kwargs):
4745
return __call__
4846

4947

50-
# Deprecate output.File in the global namespace
51-
output = _fake_module(
52-
"firedrake.output",
53-
["File", ],
54-
["VTKFile", ]
55-
)
56-
57-
58-
# I hate it
59-
def File(*args, **kwargs):
60-
"""Deprecated File constructor.
61-
62-
Use `VTKFile` from `firedrake.output` instead
63-
"""
64-
from .output import VTKFile
65-
warn(
66-
"The use of `File` for output is deprecated, please update your "
67-
"code to use `VTKFile` from `firedrake.output`."
68-
)
69-
return VTKFile(*args, **kwargs)
70-
71-
7248
# Deprecate plotting in the global namespace
7349
plot = _fake_module(
7450
"firedrake.pyplot",

0 commit comments

Comments
 (0)