Skip to content

Commit 33b0ff7

Browse files
committed
Renamomg bugs
1 parent 2b0ddc5 commit 33b0ff7

7 files changed

Lines changed: 42 additions & 42 deletions

File tree

tests/3_system/test_custom_compset_std_grid.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from visualCaseGen.initialize_stages import initialize_stages
1717
from visualCaseGen.specs.options import set_options
1818
from visualCaseGen.specs.relational_constraints import get_relational_constraints
19-
from regional_mom_workflows.CrocoDash.CrocoDash.visualCaseGen.visualCaseGen.custom_widget_types.mom6_forge_launcher import MOM6BathyLauncher
19+
from regional_mom_workflows.CrocoDash.CrocoDash.visualCaseGen.visualCaseGen.custom_widget_types.mom6_forge_launcher import MOM6ForgeLauncher
2020
from visualCaseGen.custom_widget_types.case_creator_widget import CaseCreatorWidget
2121
from tests.utils import safe_create_case
2222

tests/3_system/test_custom_mom6_grid.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from visualCaseGen.initialize_stages import initialize_stages
1717
from visualCaseGen.specs.options import set_options
1818
from visualCaseGen.specs.relational_constraints import get_relational_constraints
19-
from regional_mom_workflows.CrocoDash.CrocoDash.visualCaseGen.visualCaseGen.custom_widget_types.mom6_forge_launcher import MOM6BathyLauncher
19+
from regional_mom_workflows.CrocoDash.CrocoDash.visualCaseGen.visualCaseGen.custom_widget_types.mom6_forge_launcher import MOM6ForgeLauncher
2020
from visualCaseGen.custom_widget_types.case_creator_widget import CaseCreatorWidget
2121
from tests.utils import safe_create_case
2222

@@ -93,7 +93,7 @@ def test_custom_mom6_grid():
9393
# now launch the mom6_forge notebook
9494

9595
mom6_forge_launcher_widget = Stage.active()._widget._main_body.children[-1]
96-
assert isinstance(mom6_forge_launcher_widget, MOM6BathyLauncher)
96+
assert isinstance(mom6_forge_launcher_widget, MOM6ForgeLauncher)
9797

9898
# After setting all the required parameters, the launch button should be enabled
9999
assert mom6_forge_launcher_widget._btn_launch_mom6_forge.disabled is False

tests/3_system/test_f2000_custom_grid.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from visualCaseGen.specs.relational_constraints import get_relational_constraints
1919
from visualCaseGen.custom_widget_types.clm_modifier_launcher import MeshMaskModifierLauncher, FsurdatModifierLauncher
2020
from visualCaseGen.custom_widget_types.case_creator_widget import CaseCreatorWidget
21-
from regional_mom_workflows.CrocoDash.CrocoDash.visualCaseGen.visualCaseGen.custom_widget_types.mom6_forge_launcher import MOM6BathyLauncher
21+
from regional_mom_workflows.CrocoDash.CrocoDash.visualCaseGen.visualCaseGen.custom_widget_types.mom6_forge_launcher import MOM6ForgeLauncher
2222
from tests.utils import safe_create_case
2323

2424

@@ -311,7 +311,7 @@ def construct_custom_res_from_new_mom6_grid_modified_clm_grid(cime):
311311
# now launch the mom6_forge notebook
312312

313313
mom6_forge_launcher_widget = Stage.active()._widget._main_body.children[-1]
314-
assert isinstance(mom6_forge_launcher_widget, MOM6BathyLauncher)
314+
assert isinstance(mom6_forge_launcher_widget, MOM6ForgeLauncher)
315315

316316
# After setting all the required parameters, the launch button should be enabled
317317
assert mom6_forge_launcher_widget._btn_launch_mom6_forge.disabled is False

visualCaseGen/custom_widget_types/case_creator.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import math
1010

1111
from ProConPy.config_var import cvars
12-
from regional_mom_workflows.CrocoDash.CrocoDash.visualCaseGen.visualCaseGen.custom_widget_types.mom6_forge_launcher import MOM6BathyLauncher
12+
from visualCaseGen.custom_widget_types.mom6_forge_launcher import MOM6ForgeLauncher
1313
from visualCaseGen.custom_widget_types.dummy_output import DummyOutput
1414
from visualCaseGen.custom_widget_types.case_tools import xmlchange, run_case_setup, append_user_nl, is_ccs_config_writeable
1515

@@ -642,10 +642,10 @@ def _apply_mom_namelist_changes(self, do_exec):
642642
ocn_grid_mode == "Create New"
643643
), f"Unknown ocean grid mode: {ocn_grid_mode}"
644644

645-
supergrid_file_path = MOM6BathyLauncher.supergrid_file_path()
646-
topo_file_path = MOM6BathyLauncher.topo_file_path()
647-
vgrid_file_path = MOM6BathyLauncher.vgrid_file_path()
648-
ocn_grid_path = MOM6BathyLauncher.get_custom_ocn_grid_path()
645+
supergrid_file_path = MOM6ForgeLauncher.supergrid_file_path()
646+
topo_file_path = MOM6ForgeLauncher.topo_file_path()
647+
vgrid_file_path = MOM6ForgeLauncher.vgrid_file_path()
648+
ocn_grid_path = MOM6ForgeLauncher.get_custom_ocn_grid_path()
649649

650650
# read in min and max depth from the MOM6 topo file:
651651
ds_topo = xr.open_dataset(topo_file_path)
@@ -752,7 +752,7 @@ def _apply_cice_namelist_changes(self, do_exec):
752752
if not comp_ice.startswith("cice"):
753753
return
754754

755-
cice_grid_file_path = MOM6BathyLauncher.cice_grid_file_path()
755+
cice_grid_file_path = MOM6ForgeLauncher.cice_grid_file_path()
756756
self._apply_user_nl_changes(
757757
"cice",
758758
[

visualCaseGen/custom_widget_types/mom6_forge_launcher.py

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
logger = logging.getLogger("\t" + __name__.split(".")[-1])
1515

1616

17-
class MOM6BathyLauncher(VBox):
17+
class MOM6ForgeLauncher(VBox):
1818
"""A widget to create and launch a new mom6_forge notebook. The widget is enabled when all the
1919
required parameters for mom6_forge are set."""
2020

@@ -139,7 +139,7 @@ def _on_btn_confirm_completion_clicked(self, b):
139139
files are created. If so, it confirms completion of mom6_forge. If not, it displays a
140140
warning message."""
141141

142-
custom_ocn_grid_path = MOM6BathyLauncher.get_custom_ocn_grid_path()
142+
custom_ocn_grid_path = MOM6ForgeLauncher.get_custom_ocn_grid_path()
143143
if custom_ocn_grid_path is None:
144144
alert_warning(
145145
"No custom_ocn_grid_path found. Cannot confirm completion of mom6_forge"
@@ -162,10 +162,10 @@ def _on_btn_confirm_completion_clicked(self, b):
162162
)
163163

164164
# See if all required files are created:
165-
mom6_supergrid_file = MOM6BathyLauncher.supergrid_file_path()
166-
mom6_topog_file = MOM6BathyLauncher.topo_file_path()
167-
esmf_mesh_file = MOM6BathyLauncher.esmf_mesh_file_path()
168-
cice_grid_file = MOM6BathyLauncher.cice_grid_file_path()
165+
mom6_supergrid_file = MOM6ForgeLauncher.supergrid_file_path()
166+
mom6_topog_file = MOM6ForgeLauncher.topo_file_path()
167+
esmf_mesh_file = MOM6ForgeLauncher.esmf_mesh_file_path()
168+
cice_grid_file = MOM6ForgeLauncher.cice_grid_file_path()
169169
required_files = [mom6_supergrid_file, mom6_topog_file, esmf_mesh_file]
170170
if "CICE" in cvars["COMP_ICE_PHYS"].value:
171171
required_files.append(cice_grid_file)
@@ -186,9 +186,9 @@ def _on_btn_confirm_completion_clicked(self, b):
186186
def _launch_mom6_forge(self, nb_filepath):
187187
"""Generate a new mom6_forge notebook and open it in a new tab. This method gets called when
188188
the user clicks the "Launch mom6_forge" button."""
189-
nb = MOM6BathyLauncher._create_notebook_object()
190-
MOM6BathyLauncher._write_notebook(nb, nb_filepath)
191-
MOM6BathyLauncher._open_notebook_in_browser(nb_filepath)
189+
nb = MOM6ForgeLauncher._create_notebook_object()
190+
MOM6ForgeLauncher._write_notebook(nb, nb_filepath)
191+
MOM6ForgeLauncher._open_notebook_in_browser(nb_filepath)
192192

193193
@staticmethod
194194
def _create_notebook_object():
@@ -210,7 +210,7 @@ def _create_notebook_object():
210210
attempt_id = cvars['MB_ATTEMPT_ID'].value
211211

212212
# if custom_grid_path doesn't exist, create it:
213-
custom_ocn_grid_path = MOM6BathyLauncher.get_custom_ocn_grid_path()
213+
custom_ocn_grid_path = MOM6ForgeLauncher.get_custom_ocn_grid_path()
214214
os.makedirs(custom_ocn_grid_path, exist_ok=True)
215215

216216
# Create a new notebook:
@@ -314,22 +314,22 @@ def _create_notebook_object():
314314
save_files_cmd = (
315315
"# Do NOT modify this cell!\n\n"
316316
"# MOM6 supergrid file.\n"
317-
f'grid.write_supergrid(f"{MOM6BathyLauncher.supergrid_file_path()}")\n\n'
317+
f'grid.write_supergrid(f"{MOM6ForgeLauncher.supergrid_file_path()}")\n\n'
318318
"# Save MOM6 topography file:\n"
319-
f'topo.write_topo(f"{MOM6BathyLauncher.topo_file_path()}")\n\n'
319+
f'topo.write_topo(f"{MOM6ForgeLauncher.topo_file_path()}")\n\n'
320320
"# Save MOM6 vertical grid file:\n"
321-
f'vgrid.write(f"{MOM6BathyLauncher.vgrid_file_path()}")\n\n'
321+
f'vgrid.write(f"{MOM6ForgeLauncher.vgrid_file_path()}")\n\n'
322322
)
323323

324324
if "CICE" in cvars["COMP_ICE_PHYS"].value:
325325
save_files_cmd += (
326326
"# CICE grid file:\n"
327-
f'topo.write_cice_grid(f"{MOM6BathyLauncher.cice_grid_file_path()}")\n\n'
327+
f'topo.write_cice_grid(f"{MOM6ForgeLauncher.cice_grid_file_path()}")\n\n'
328328
)
329329

330330
save_files_cmd += (
331331
"# Save ESMF mesh file:\n"
332-
f'topo.write_esmf_mesh(f"{MOM6BathyLauncher.esmf_mesh_file_path()}")'
332+
f'topo.write_esmf_mesh(f"{MOM6ForgeLauncher.esmf_mesh_file_path()}")'
333333
)
334334

335335
nb["cells"].extend(
@@ -396,30 +396,30 @@ def nc_file_suffix():
396396

397397
@staticmethod
398398
def supergrid_file_path():
399-
custom_ocn_grid_path = MOM6BathyLauncher.get_custom_ocn_grid_path()
400-
return custom_ocn_grid_path / f"ocean_hgrid_{MOM6BathyLauncher.nc_file_suffix()}"
399+
custom_ocn_grid_path = MOM6ForgeLauncher.get_custom_ocn_grid_path()
400+
return custom_ocn_grid_path / f"ocean_hgrid_{MOM6ForgeLauncher.nc_file_suffix()}"
401401

402402
@staticmethod
403403
def topo_file_path():
404-
custom_ocn_grid_path = MOM6BathyLauncher.get_custom_ocn_grid_path()
405-
return custom_ocn_grid_path / f"ocean_topog_{MOM6BathyLauncher.nc_file_suffix()}"
404+
custom_ocn_grid_path = MOM6ForgeLauncher.get_custom_ocn_grid_path()
405+
return custom_ocn_grid_path / f"ocean_topog_{MOM6ForgeLauncher.nc_file_suffix()}"
406406

407407
@staticmethod
408408
def vgrid_file_path():
409-
custom_ocn_grid_path = MOM6BathyLauncher.get_custom_ocn_grid_path()
410-
return custom_ocn_grid_path / f"ocean_vgrid_{MOM6BathyLauncher.nc_file_suffix()}"
409+
custom_ocn_grid_path = MOM6ForgeLauncher.get_custom_ocn_grid_path()
410+
return custom_ocn_grid_path / f"ocean_vgrid_{MOM6ForgeLauncher.nc_file_suffix()}"
411411

412412
@staticmethod
413413
def scrip_grid_file_path():
414-
custom_ocn_grid_path = MOM6BathyLauncher.get_custom_ocn_grid_path()
415-
return custom_ocn_grid_path / f"scrip_{MOM6BathyLauncher.nc_file_suffix()}"
414+
custom_ocn_grid_path = MOM6ForgeLauncher.get_custom_ocn_grid_path()
415+
return custom_ocn_grid_path / f"scrip_{MOM6ForgeLauncher.nc_file_suffix()}"
416416

417417
@staticmethod
418418
def esmf_mesh_file_path():
419-
custom_ocn_grid_path = MOM6BathyLauncher.get_custom_ocn_grid_path()
420-
return custom_ocn_grid_path / f"ESMF_mesh_{MOM6BathyLauncher.nc_file_suffix()}"
419+
custom_ocn_grid_path = MOM6ForgeLauncher.get_custom_ocn_grid_path()
420+
return custom_ocn_grid_path / f"ESMF_mesh_{MOM6ForgeLauncher.nc_file_suffix()}"
421421

422422
@staticmethod
423423
def cice_grid_file_path():
424-
custom_ocn_grid_path = MOM6BathyLauncher.get_custom_ocn_grid_path()
425-
return custom_ocn_grid_path / f"cice_grid_{MOM6BathyLauncher.nc_file_suffix()}"
424+
custom_ocn_grid_path = MOM6ForgeLauncher.get_custom_ocn_grid_path()
425+
return custom_ocn_grid_path / f"cice_grid_{MOM6ForgeLauncher.nc_file_suffix()}"

visualCaseGen/custom_widget_types/runoff_mapping_generator.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from ProConPy.config_var import cvars
77
from ProConPy.dialog import alert_warning
88
from mom6_forge import mapping
9-
from regional_mom_workflows.CrocoDash.CrocoDash.visualCaseGen.visualCaseGen.custom_widget_types.mom6_forge_launcher import MOM6BathyLauncher
9+
from visualCaseGen.custom_widget_types.mom6_forge_launcher import MOM6ForgeLauncher
1010

1111
class RunoffMappingGenerator(VBox):
1212
"""Widget to generate runoff to ocean mapping for custom grids.
@@ -138,7 +138,7 @@ def get_ocn_grid_and_mesh(self):
138138
ocn_mesh_path = self.cime.get_mesh_path("ocnice", ocn_grid)
139139
case "Create New":
140140
ocn_grid = cvars["CUSTOM_OCN_GRID_NAME"].value
141-
ocn_mesh_path = MOM6BathyLauncher.esmf_mesh_file_path()
141+
ocn_mesh_path = MOM6ForgeLauncher.esmf_mesh_file_path()
142142
case _:
143143
assert False, f"Unsupported OCN_GRID_MODE: {ocn_grid_mode}"
144144

visualCaseGen/stages/grid_stages.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from ProConPy.stage import Stage, Guard
1010
from ProConPy.out_handler import handler as owh
1111
from visualCaseGen.custom_widget_types.stage_widget import StageWidget
12-
from regional_mom_workflows.CrocoDash.CrocoDash.visualCaseGen.visualCaseGen.custom_widget_types.mom6_forge_launcher import MOM6BathyLauncher
12+
from visualCaseGen.custom_widget_types.mom6_forge_launcher import MOM6ForgeLauncher
1313
from visualCaseGen.custom_widget_types.clm_modifier_launcher import MeshMaskModifierLauncher, FsurdatModifierLauncher
1414
from visualCaseGen.custom_widget_types.runoff_mapping_generator import RunoffMappingGenerator
1515

@@ -109,7 +109,7 @@ def initialize_grid_stages(cime):
109109
"button to proceed to the next stage.",
110110
widget=StageWidget(
111111
VBox,
112-
supplementary_widgets=[MOM6BathyLauncher()]
112+
supplementary_widgets=[MOM6ForgeLauncher()]
113113
),
114114
parent=Guard(
115115
title="Custom Ocn Grid",

0 commit comments

Comments
 (0)