Skip to content

Commit 4218cd5

Browse files
committed
Remove flag day change
1 parent b642ecb commit 4218cd5

File tree

2 files changed

+22
-3
lines changed

2 files changed

+22
-3
lines changed

firedrake/__init__.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,11 @@
127127
set_log_handlers(comm=COMM_WORLD)
128128

129129
# Moved functionality
130-
from firedrake._deprecation import output, plot
131-
sys.modules["firedrake.output"] = output
132-
from firedrake.output import *
130+
from firedrake._deprecation import plot, File # noqa: F401
131+
# Once `File` is deprecated update the above line removing `File` and add
132+
# from firedrake._deprecation import output
133+
# sys.modules["firedrake.output"] = output
134+
# from firedrake.output import *
133135
sys.modules["firedrake.plot"] = plot
134136
from firedrake.plot import *
135137

firedrake/_deprecation.py

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

5+
from warnings import warn
6+
57

68
class _fake_module:
79
""" Object which behaves like a module
@@ -52,6 +54,21 @@ def __call__(*args, **kwargs):
5254
["VTKFile",]
5355
)
5456

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+
5572
# Deprecate plotting in the global namespace
5673
plot = _fake_module(
5774
"firedrake.pyplot",

0 commit comments

Comments
 (0)