File tree Expand file tree Collapse file tree 2 files changed +22
-3
lines changed Expand file tree Collapse file tree 2 files changed +22
-3
lines changed Original file line number Diff line number Diff line change 127127set_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
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 *
133135sys .modules ["firedrake.plot" ] = plot
134136from firedrake .plot import *
135137
Original file line number Diff line number Diff line change 22"""
33import importlib
44
5+ from warnings import warn
6+
57
68class _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
5673plot = _fake_module (
5774 "firedrake.pyplot" ,
You can’t perform that action at this time.
0 commit comments