3636from ert .namespace import Namespace
3737from ert .plugins import ErtRuntimePlugins , get_site_plugins , setup_site_logging
3838from ert .run_models .multiple_data_assimilation import MultipleDataAssimilationConfig
39- from ert .services import ErtServer , WebvizErt
39+ from ert .services import ErtServer
4040from ert .shared .status .utils import get_ert_memory_usage
4141from ert .shared .storage .command import add_parser_options as ert_api_add_parser_options
4242from ert .storage import ErtStorageException , ErtStoragePermissionError
@@ -62,56 +62,6 @@ def run_ert_storage(args: Namespace, _: ErtRuntimePlugins | None = None) -> None
6262 server .wait ()
6363
6464
65- def run_webviz_ert (args : Namespace , _ : ErtRuntimePlugins | None = None ) -> None :
66- try :
67- import webviz_ert # type: ignore # noqa
68- except ImportError as err :
69- raise ValueError (
70- "Running `ert vis` requires that webviz_ert is installed"
71- ) from err
72-
73- kwargs : dict [str , Any ] = {"verbose" : args .verbose }
74- ert_config = ErtConfig .with_plugins (get_site_plugins ()).from_file (args .config )
75-
76- os .chdir (ert_config .config_path )
77- ens_path = ert_config .ens_path
78-
79- # Changing current working directory means we need to
80- # only use the base name of the config file path
81- kwargs ["ert_config" ] = os .path .basename (args .config )
82- kwargs ["project" ] = os .path .abspath (ens_path )
83- try :
84- with ErtServer .init_service (project = Path (ens_path ).absolute ()) as storage :
85- storage .wait_until_ready ()
86- print (
87- """
88- -----------------------------------------------------------
89-
90- Starting up Webviz-ERT. This might take more than a minute.
91-
92- -----------------------------------------------------------
93- """
94- )
95- webviz_kwargs = {
96- "experimental_mode" : args .experimental_mode ,
97- "verbose" : args .verbose ,
98- "title" : kwargs .get ("ert_config" , "ERT - Visualization tool" ),
99- "project" : kwargs .get ("project" , os .getcwd ()),
100- }
101- with WebvizErt .start_server (** webviz_kwargs ) as webviz_ert_server :
102- webviz_ert_server .wait ()
103- except PermissionError as pe :
104- print (f"Error: { pe } " , file = sys .stderr )
105- print (
106- "Cannot start or connect to storage service due to permission issues." ,
107- file = sys .stderr ,
108- )
109- print (
110- "This is most likely due to another user starting ERT using this storage" ,
111- file = sys .stderr ,
112- )
113-
114-
11565def strip_error_message_and_raise_exception (validated : ValidationStatus ) -> None :
11666 error = validated .message ()
11767 error = re .sub (r"\<[^>]*\>" , " " , error )
@@ -303,19 +253,6 @@ def get_ert_parser(parser: ArgumentParser | None = None) -> ArgumentParser:
303253 ert_api_parser .set_defaults (func = run_ert_storage )
304254 ert_api_add_parser_options (ert_api_parser )
305255
306- ert_vis_parser = subparsers .add_parser (
307- "vis" ,
308- description = "Launch webviz-driven visualization tool." ,
309- )
310- ert_vis_parser .set_defaults (func = run_webviz_ert )
311- ert_vis_parser .add_argument ("--name" , "-n" , type = str , default = "Webviz-ERT" )
312- ert_vis_parser .add_argument (
313- "--experimental-mode" ,
314- action = "store_true" ,
315- help = "Feature flag for enabling experimental plugins" ,
316- )
317- ert_api_add_parser_options (ert_vis_parser ) # ert vis shares args with ert api
318-
319256 # test_run_parser
320257 test_run_description = f"Run '{ TEST_RUN_MODE } ' in cli"
321258 test_run_parser = subparsers .add_parser (
0 commit comments