From 9baa447589f4fe86f3ca7b37515f331a7f4e1097 Mon Sep 17 00:00:00 2001 From: manishvenu Date: Fri, 27 Mar 2026 07:35:20 -0600 Subject: [PATCH 01/10] Try This --- .github/workflows/ci-tests.yml | 7 ++++++- environment.yml | 6 +++--- external/mom6_forge | 2 +- pyproject.toml | 28 ++++++++++++++-------------- 4 files changed, 24 insertions(+), 19 deletions(-) diff --git a/.github/workflows/ci-tests.yml b/.github/workflows/ci-tests.yml index 7e9498c..a8dda5c 100644 --- a/.github/workflows/ci-tests.yml +++ b/.github/workflows/ci-tests.yml @@ -10,8 +10,12 @@ on: jobs: ci_tests: - name: visualCaseGen CI tests + name: visualCaseGen CI tests (Python ${{ matrix.python-version }}) runs-on: "ubuntu-latest" + strategy: + fail-fast: false + matrix: + python-version: ["3.11", "3.12", "3.13", "3.14"] defaults: run: shell: bash -el {0} @@ -56,6 +60,7 @@ jobs: - name: Create visualCaseGen conda env run: | cd CESM/visualCaseGen/ + sed -i "s/python>=3.11.10/python=${{ matrix.python-version }}.*/" environment.yml conda env create --file environment.yml conda activate visualCaseGen diff --git a/environment.yml b/environment.yml index dcf347e..b70d4ee 100644 --- a/environment.yml +++ b/environment.yml @@ -5,9 +5,9 @@ channels: - anaconda dependencies: - - python>=3.11.10,<3.12 - - libxml2>=2.13,<2.14 - - xesmf>=0.8.10,<0.9 + - python>=3.11.10 + - libxml2>=2.13 + - xesmf>=0.8.10 - pip - pip: - -e ./external/mom6_bathy/ diff --git a/external/mom6_forge b/external/mom6_forge index 72b50c8..3310965 160000 --- a/external/mom6_forge +++ b/external/mom6_forge @@ -1 +1 @@ -Subproject commit 72b50c8bd19336f9065054a55a9a4db8b4ab2c4a +Subproject commit 331096585729eedfb1c0d84443895ca5952dd495 diff --git a/pyproject.toml b/pyproject.toml index 4d0c3f9..55cee12 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,21 +13,21 @@ classifiers = [ "Programming Language :: Python", "Framework :: Jupyter" ] -requires-python = ">=3.11.10,<3.12" +requires-python = ">=3.11.10" dependencies = [ - "ipykernel>=6.29,<6.30", - "ipython>=8.2,<8.3", - "jupyterlab>=4.0,<4.1", - "jupyterlab_server>=2.25,<2.26", - "ipywidgets>=8.1.1,<8.2", - "PyYAML>=6.0,<6.1", - "z3-solver>=4.12.3,<4.13", - "networkx>=3.3,<3.4", - "netcdf4>=1.6,<1.7", - "xarray>=2023.12,<2024", - "black>=24.1,<24.2", - "pytest>=8.0,<8.1", - "hypothesis>=6.125.1,<6.126" + "ipykernel>=6.29", + "ipython>=8.2", + "jupyterlab>=4.0", + "jupyterlab_server>=2.25", + "ipywidgets>=8.1.1", + "PyYAML>=6.0", + "z3-solver>=4.12.3", + "networkx>=3.3", + "netcdf4>=1.6", + "xarray>=2023.12", + "black>=24.1", + "pytest>=8.0", + "hypothesis>=6.125.1" ] [build-system] From e078c771bb4f1b6bc2c43f35f99c182055e3ed3e Mon Sep 17 00:00:00 2001 From: manishvenu Date: Fri, 27 Mar 2026 07:39:53 -0600 Subject: [PATCH 02/10] This --- .gitmodules | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitmodules b/.gitmodules index 10d4aae..e73ad27 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,6 @@ -[submodule "external/mom6_bathy"] - path = external/mom6_bathy - url = https://github.com/NCAR/mom6_bathy.git +[submodule "external/mom6_forge"] + path = external/mom6_forge + url = https://github.com/NCAR/mom6_forge.git [submodule "external/ipyfilechooser"] path = external/ipyfilechooser url = https://github.com/alperaltuntas/ipyfilechooser.git From bed3a5f8aa459472f91d3c98abbedfbad0845201 Mon Sep 17 00:00:00 2001 From: manishvenu Date: Fri, 27 Mar 2026 11:37:26 -0600 Subject: [PATCH 03/10] Remove submodule' --- external/mom6_bathy | 1 - 1 file changed, 1 deletion(-) delete mode 160000 external/mom6_bathy diff --git a/external/mom6_bathy b/external/mom6_bathy deleted file mode 160000 index cc9c76f..0000000 --- a/external/mom6_bathy +++ /dev/null @@ -1 +0,0 @@ -Subproject commit cc9c76fce21404af910a5c8980354353be346366 From ddddf539d9edcc62c21304a4e9c504e2b1f36ab2 Mon Sep 17 00:00:00 2001 From: manishvenu Date: Fri, 27 Mar 2026 11:43:02 -0600 Subject: [PATCH 04/10] Fix This --- environment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/environment.yml b/environment.yml index b70d4ee..87e2921 100644 --- a/environment.yml +++ b/environment.yml @@ -10,6 +10,6 @@ dependencies: - xesmf>=0.8.10 - pip - pip: - - -e ./external/mom6_bathy/ + - -e ./external/mom6_forge/ - -e ./external/ipyfilechooser/ - -e ./ # visualCaseGen From 5c0571633141e34d2b574dc5b3aa10d262834d1e Mon Sep 17 00:00:00 2001 From: manishvenu Date: Fri, 27 Mar 2026 12:21:41 -0600 Subject: [PATCH 05/10] Limit to 3.12 --- .github/workflows/ci-tests.yml | 2 +- environment.yml | 6 +++--- pyproject.toml | 28 ++++++++++++++-------------- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/.github/workflows/ci-tests.yml b/.github/workflows/ci-tests.yml index a8dda5c..fd123f4 100644 --- a/.github/workflows/ci-tests.yml +++ b/.github/workflows/ci-tests.yml @@ -15,7 +15,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.11", "3.12", "3.13", "3.14"] + python-version: ["3.11", "3.12"] defaults: run: shell: bash -el {0} diff --git a/environment.yml b/environment.yml index 87e2921..dd45833 100644 --- a/environment.yml +++ b/environment.yml @@ -5,9 +5,9 @@ channels: - anaconda dependencies: - - python>=3.11.10 - - libxml2>=2.13 - - xesmf>=0.8.10 + - python>=3.11.10,<3.13.0 + - libxml2>=2.13,<2.16 + - xesmf>=0.8.10,<0.10.0 - pip - pip: - -e ./external/mom6_forge/ diff --git a/pyproject.toml b/pyproject.toml index 55cee12..43328bc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,21 +13,21 @@ classifiers = [ "Programming Language :: Python", "Framework :: Jupyter" ] -requires-python = ">=3.11.10" +requires-python = ">=3.11.10,<3.13.0" dependencies = [ - "ipykernel>=6.29", - "ipython>=8.2", - "jupyterlab>=4.0", - "jupyterlab_server>=2.25", - "ipywidgets>=8.1.1", - "PyYAML>=6.0", - "z3-solver>=4.12.3", - "networkx>=3.3", - "netcdf4>=1.6", - "xarray>=2023.12", - "black>=24.1", - "pytest>=8.0", - "hypothesis>=6.125.1" + "ipykernel>=6.29,<7.3.0", + "ipython>=8.2",<9.13, + "jupyterlab>=4.0,<4.6.0", + "jupyterlab_server>=2.25,<2.29.0", + "ipywidgets>=8.1.1,<8.2.0", + "PyYAML>=6.0,<6.1.0", + "z3-solver>=4.12.3,<4.17.0", + "networkx>=3.3,<3.7.0", + "netcdf4>=1.6,<1.8.0", + "xarray>=2023.12,<2026.3.0", + "black>=24.1,<26.4.0", + "pytest>=8.0,<9.1.0", + "hypothesis>=6.125.1,<6.152.0" ] [build-system] From d62fd497799b77a6bf26eef13521c0f9ee501c5b Mon Sep 17 00:00:00 2001 From: manishvenu Date: Fri, 27 Mar 2026 12:29:39 -0600 Subject: [PATCH 06/10] This --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 43328bc..1a5d612 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,7 +16,7 @@ classifiers = [ requires-python = ">=3.11.10,<3.13.0" dependencies = [ "ipykernel>=6.29,<7.3.0", - "ipython>=8.2",<9.13, + "ipython>=8.2,<9.13", "jupyterlab>=4.0,<4.6.0", "jupyterlab_server>=2.25,<2.29.0", "ipywidgets>=8.1.1,<8.2.0", From 2b0ddc512ce2446b1c4aedad3ef2a48a2688804f Mon Sep 17 00:00:00 2001 From: manishvenu Date: Thu, 2 Apr 2026 15:09:47 -0600 Subject: [PATCH 07/10] Full renaming --- docs/grid.rst | 12 +-- docs/ridge.rst | 18 ++-- docs/troubleshooting.rst | 6 +- external/mom6_forge | 2 +- internal/README.md | 2 +- .../README.md | 2 +- .../3_system/test_custom_compset_std_grid.py | 2 +- tests/3_system/test_custom_mom6_grid.py | 24 +++--- tests/3_system/test_f2000_custom_grid.py | 22 ++--- visualCaseGen/config_vars/grid_vars.py | 2 +- .../custom_widget_types/case_creator.py | 4 +- ...thy_launcher.py => mom6_forge_launcher.py} | 84 +++++++++---------- .../runoff_mapping_generator.py | 8 +- visualCaseGen/specs/relational_constraints.py | 2 +- visualCaseGen/stages/grid_stages.py | 8 +- visualCaseGen/widgets/grid_widgets.py | 6 +- 16 files changed, 102 insertions(+), 102 deletions(-) rename {mom6_bathy_notebooks => mom6_forge_notebooks}/README.md (63%) rename visualCaseGen/custom_widget_types/{mom6_bathy_launcher.py => mom6_forge_launcher.py} (86%) diff --git a/docs/grid.rst b/docs/grid.rst index db434c7..9da180d 100644 --- a/docs/grid.rst +++ b/docs/grid.rst @@ -64,23 +64,23 @@ Ocean Grid For the ocean grid, if MOM6 is selected as the ocean model, you can either select a standard ocean grid or create a new MOM6 grid. When creating a new MOM6 grid, you'll specify parameters such as grid extent and resolution, after which you'll be directed to a separate notebook that -uses the `mom6_bathy` tool to generate the new grid and bathymetry. +uses the `mom6_forge` tool to generate the new grid and bathymetry. If using a standard ocean grid, select one from the list compatible with your chosen compset and atmosphere grid. If creating a new MOM6 grid, complete the required parameters, then proceed -to launch the `mom6_bathy` tool for final customization. +to launch the `mom6_forge` tool for final customization. .. image:: assets/Stage2_6.png -After specifying all ocean grid parameters, click `Launch mom6_bathy`. This will open an +After specifying all ocean grid parameters, click `Launch mom6_forge`. This will open an auto-generated Jupyter notebook where you can fine-tune the ocean grid, topography, and vertical grid. You can then generate the corresponding MOM6 input files, which will be saved under `ocnice` subdirectory within the directory you specified earlier for saving the new grid files. -For more details on mom6_bathy, refer to its documentation: https://ncar.github.io/mom6_bathy/ +For more details on mom6_forge, refer to its documentation: https://ncar.github.io/mom6_forge/ -.. note:: If the `mom6_bathy` notebook doesn't open automatically, make sure that your browser allows +.. note:: If the `mom6_forge` notebook doesn't open automatically, make sure that your browser allows pop-ups from visualCaseGen. If the notebook still doesn't open, you can manually launch it by - navigating to the `mom6_bathy_notebooks/` directory in your visualCaseGen installation and opening + navigating to the `mom6_forge_notebooks/` directory in your visualCaseGen installation and opening the notebook corresponding to your custom grid. Ocean Initial conditions diff --git a/docs/ridge.rst b/docs/ridge.rst index 0fd4fe6..07b23d3 100644 --- a/docs/ridge.rst +++ b/docs/ridge.rst @@ -126,18 +126,18 @@ assign a unique name to your custom ocean grid. .. image:: assets/ridge7.png -After specifying all ocean grid parameters, click the green **Launch mom6_bathy** button. This will open an auto-generated +After specifying all ocean grid parameters, click the green **Launch mom6_forge** button. This will open an auto-generated Jupyter notebook where you can further customize the ocean bathymetry and generate all necessary grid input files. -The mom6_bathy tool +The mom6_forge tool ~~~~~~~~~~~~~~~~~~~ -.. important:: If the `mom6_bathy` notebook doesn't open automatically, make sure that your browser allows +.. important:: If the `mom6_forge` notebook doesn't open automatically, make sure that your browser allows pop-ups from visualCaseGen. If the notebook still doesn't open, you can manually launch it by - navigating to the `mom6_bathy_notebooks/` directory in your visualCaseGen installation and opening + navigating to the `mom6_forge_notebooks/` directory in your visualCaseGen installation and opening the notebook corresponding to your custom grid. -Once the auto-generated `mom6_bathy` notebook is open, you will see a series of cells that guide you through +Once the auto-generated `mom6_forge` notebook is open, you will see a series of cells that guide you through the process of creating your custom ocean bathymetry. Before proceeding, make sure that the appropriate kernel is selected in the top right corner of the notebook. Then, execute the first two cells to import the necessary libraries and to instantiate the `Grid` object. Notice that the `Grid` object is initialized @@ -145,12 +145,12 @@ with the parameters you specified in visualCaseGen. .. image:: assets/ridge8.png -The third section of mom6_bathy is where a custom bathymetry may be defined. The default option is to produce +The third section of mom6_forge is where a custom bathymetry may be defined. The default option is to produce a flat ocean bottom of depth 2000m. We are going to instead generate an ocean that resembles the ridge world case of `Wu et al (2021) `_ , which has a depth 4000m with some sinusoidal fluctuations, a land ridge of width 1 degree longitude and the furthest poleward 10 degrees latitude at the poles set to land. We will specify this analytically with python -code within mom6_bathy. +code within mom6_forge. First, instantiate the topo object by running the cell below. Note that the `min_depth` parameter, which is set to 10.0m by default determines the minimum bathymetric depth for a cell to be considered ocean. @@ -199,7 +199,7 @@ You can plot the bathymetry to see the results by running the cell below: Vertical Grid ~~~~~~~~~~~~~ -Next, you will need to set up the vertical grid. In the `mom6_bathy` notebook, +Next, you will need to set up the vertical grid. In the `mom6_forge` notebook, a default vertical grid is provided, which consists of 20 layers, and a ratio of 10, which means that the thicknesses of layers gradually increase with depth, and the thickness of the bottom layer is 10 times thicker than the top layer. @@ -222,7 +222,7 @@ vertical grid files (needed by MOM6), CICE grid file (needed by the sea ice mode (needed by the CESM coupler). .. warning:: The paths specified in the cell below are for illustrative purposes only. Do not modify the paths - in your auto-generated `mom6_bathy` notebook. The paths are unique to the user's system and should not be changed, + in your auto-generated `mom6_forge` notebook. The paths are unique to the user's system and should not be changed, since doing so will prevent visualCaseGen from confirming that the grid files have been successfully generated and will prevent configuring CESM accurately. diff --git a/docs/troubleshooting.rst b/docs/troubleshooting.rst index 3ba2aac..bbb7cdf 100644 --- a/docs/troubleshooting.rst +++ b/docs/troubleshooting.rst @@ -23,13 +23,13 @@ Commonly Encountered Issues right corner of the welcome dialog to see if any error messages are displayed. If so, submit an issue on the visualCaseGen GitHub repository with the error messages. -- **mom6_bathy notebook doesn't open automatically:** If the `mom6_bathy` notebook doesn't open automatically, +- **mom6_forge notebook doesn't open automatically:** If the `mom6_forge` notebook doesn't open automatically, make sure that your browser allows pop-ups from visualCaseGen. If the notebook still doesn't open, you can manually launch it by - navigating to the `mom6_bathy_notebooks/` directory in your visualCaseGen installation and opening + navigating to the `mom6_forge_notebooks/` directory in your visualCaseGen installation and opening the notebook corresponding to your custom grid. -- **The mom6_bathy interactive point-and-click feature is not working on JupyterHub.** +- **The mom6_forge interactive point-and-click feature is not working on JupyterHub.** If you are experiencing issues with interactive features, such as point-and-click highlighting of individual cells, you may need to (re)install the ipympl extension. Steps to (re)install the ipympl extension: (1) Open JupyterHub. (2) Locate the *Extension Manager* tab on the left sidebar: Look for an icon that resembles a puzzle diff --git a/external/mom6_forge b/external/mom6_forge index 3310965..844b5fb 160000 --- a/external/mom6_forge +++ b/external/mom6_forge @@ -1 +1 @@ -Subproject commit 331096585729eedfb1c0d84443895ca5952dd495 +Subproject commit 844b5fb1ae28edc5e64d732e98891d9bbe76b6a5 diff --git a/internal/README.md b/internal/README.md index d987ef7..bbe0200 100644 --- a/internal/README.md +++ b/internal/README.md @@ -1 +1 @@ -This subdirectory is internally used by visualCaseGen to exchange information with mom6_bathy and other tools. Manually interfering with files in this directory may disrupt any active visualCaseGen session. \ No newline at end of file +This subdirectory is internally used by visualCaseGen to exchange information with mom6_forge and other tools. Manually interfering with files in this directory may disrupt any active visualCaseGen session. \ No newline at end of file diff --git a/mom6_bathy_notebooks/README.md b/mom6_forge_notebooks/README.md similarity index 63% rename from mom6_bathy_notebooks/README.md rename to mom6_forge_notebooks/README.md index 9dbcd0f..a02ba39 100644 --- a/mom6_bathy_notebooks/README.md +++ b/mom6_forge_notebooks/README.md @@ -1,2 +1,2 @@ -This directory is for storing mom6_bathy notebooks generated by visualCaseGen. +This directory is for storing mom6_forge notebooks generated by visualCaseGen. When you are done with a notebook, you may manually remove or store it for documentation purposes. \ No newline at end of file diff --git a/tests/3_system/test_custom_compset_std_grid.py b/tests/3_system/test_custom_compset_std_grid.py index e591546..c859a39 100755 --- a/tests/3_system/test_custom_compset_std_grid.py +++ b/tests/3_system/test_custom_compset_std_grid.py @@ -16,7 +16,7 @@ from visualCaseGen.initialize_stages import initialize_stages from visualCaseGen.specs.options import set_options from visualCaseGen.specs.relational_constraints import get_relational_constraints -from visualCaseGen.custom_widget_types.mom6_bathy_launcher import MOM6BathyLauncher +from regional_mom_workflows.CrocoDash.CrocoDash.visualCaseGen.visualCaseGen.custom_widget_types.mom6_forge_launcher import MOM6BathyLauncher from visualCaseGen.custom_widget_types.case_creator_widget import CaseCreatorWidget from tests.utils import safe_create_case diff --git a/tests/3_system/test_custom_mom6_grid.py b/tests/3_system/test_custom_mom6_grid.py index 6e81201..865130c 100755 --- a/tests/3_system/test_custom_mom6_grid.py +++ b/tests/3_system/test_custom_mom6_grid.py @@ -16,7 +16,7 @@ from visualCaseGen.initialize_stages import initialize_stages from visualCaseGen.specs.options import set_options from visualCaseGen.specs.relational_constraints import get_relational_constraints -from visualCaseGen.custom_widget_types.mom6_bathy_launcher import MOM6BathyLauncher +from regional_mom_workflows.CrocoDash.CrocoDash.visualCaseGen.visualCaseGen.custom_widget_types.mom6_forge_launcher import MOM6BathyLauncher from visualCaseGen.custom_widget_types.case_creator_widget import CaseCreatorWidget from tests.utils import safe_create_case @@ -90,24 +90,24 @@ def test_custom_mom6_grid(): cvars["OCN_LENY"].value = 160.0 cvars["CUSTOM_OCN_GRID_NAME"].value = "custom_ocn_grid" - # now launch the mom6_bathy notebook + # now launch the mom6_forge notebook - mom6_bathy_launcher_widget = Stage.active()._widget._main_body.children[-1] - assert isinstance(mom6_bathy_launcher_widget, MOM6BathyLauncher) + mom6_forge_launcher_widget = Stage.active()._widget._main_body.children[-1] + assert isinstance(mom6_forge_launcher_widget, MOM6BathyLauncher) # After setting all the required parameters, the launch button should be enabled - assert mom6_bathy_launcher_widget._btn_launch_mom6_bathy.disabled is False + assert mom6_forge_launcher_widget._btn_launch_mom6_forge.disabled is False # *Click* the launch button - mom6_bathy_launcher_widget._on_btn_launch_clicked(b=None) + mom6_forge_launcher_widget._on_btn_launch_clicked(b=None) # The confirm button should be visible: assert ( - mom6_bathy_launcher_widget._btn_confirm_completion.layout.display != "none" + mom6_forge_launcher_widget._btn_confirm_completion.layout.display != "none" ) # *Click* the confirm button - mom6_bathy_launcher_widget._on_btn_confirm_completion_clicked(b=None) + mom6_forge_launcher_widget._on_btn_confirm_completion_clicked(b=None) # Since the notebook wasn't fully executed, we should remain in the same stage assert Stage.active().title.startswith("Custom Ocean") @@ -116,10 +116,10 @@ def test_custom_mom6_grid(): import nbformat from nbconvert.preprocessors import ExecutePreprocessor, CellExecutionError - # find the only mom6_bathy_*.ipynb file in the mom6_bathy_notebooks directory + # find the only mom6_forge_*.ipynb file in the mom6_forge_notebooks directory ocn_grid_name = cvars['CUSTOM_OCN_GRID_NAME'].value - nb_files = list(Path("mom6_bathy_notebooks").glob(f"mom6_bathy_{ocn_grid_name}*.ipynb")) - assert len(nb_files) == 1, "Expected only one mom6_bathy notebook file" + nb_files = list(Path("mom6_forge_notebooks").glob(f"mom6_forge_{ocn_grid_name}*.ipynb")) + assert len(nb_files) == 1, "Expected only one mom6_forge notebook file" nb_path = nb_files[0] with open(nb_path, "r") as f: @@ -173,7 +173,7 @@ def test_custom_mom6_grid(): # If the error is not related to machine porting, raise it raise e - # remove mom6_bathy notebook belonging to the test_grid: + # remove mom6_forge notebook belonging to the test_grid: if os.path.exists(nb_path): os.remove(nb_path) diff --git a/tests/3_system/test_f2000_custom_grid.py b/tests/3_system/test_f2000_custom_grid.py index 7ef9124..7104625 100755 --- a/tests/3_system/test_f2000_custom_grid.py +++ b/tests/3_system/test_f2000_custom_grid.py @@ -18,7 +18,7 @@ from visualCaseGen.specs.relational_constraints import get_relational_constraints from visualCaseGen.custom_widget_types.clm_modifier_launcher import MeshMaskModifierLauncher, FsurdatModifierLauncher from visualCaseGen.custom_widget_types.case_creator_widget import CaseCreatorWidget -from visualCaseGen.custom_widget_types.mom6_bathy_launcher import MOM6BathyLauncher +from regional_mom_workflows.CrocoDash.CrocoDash.visualCaseGen.visualCaseGen.custom_widget_types.mom6_forge_launcher import MOM6BathyLauncher from tests.utils import safe_create_case @@ -308,30 +308,30 @@ def construct_custom_res_from_new_mom6_grid_modified_clm_grid(cime): cvars["OCN_LENY"].value = 160.0 cvars["CUSTOM_OCN_GRID_NAME"].value = "custom_ocn_grid" - # now launch the mom6_bathy notebook + # now launch the mom6_forge notebook - mom6_bathy_launcher_widget = Stage.active()._widget._main_body.children[-1] - assert isinstance(mom6_bathy_launcher_widget, MOM6BathyLauncher) + mom6_forge_launcher_widget = Stage.active()._widget._main_body.children[-1] + assert isinstance(mom6_forge_launcher_widget, MOM6BathyLauncher) # After setting all the required parameters, the launch button should be enabled - assert mom6_bathy_launcher_widget._btn_launch_mom6_bathy.disabled is False + assert mom6_forge_launcher_widget._btn_launch_mom6_forge.disabled is False # *Click* the launch button - mom6_bathy_launcher_widget._on_btn_launch_clicked(b=None) + mom6_forge_launcher_widget._on_btn_launch_clicked(b=None) # The confirm button should be visible: assert ( - mom6_bathy_launcher_widget._btn_confirm_completion.layout.display != "none" + mom6_forge_launcher_widget._btn_confirm_completion.layout.display != "none" ) # now, programmatically run the notebook import nbformat from nbconvert.preprocessors import ExecutePreprocessor, CellExecutionError - # find the only mom6_bathy_*.ipynb file in the mom6_bathy_notebooks directory + # find the only mom6_forge_*.ipynb file in the mom6_forge_notebooks directory ocn_grid_name = cvars['CUSTOM_OCN_GRID_NAME'].value - nb_files = list(Path("mom6_bathy_notebooks").glob(f"mom6_bathy_{ocn_grid_name}*.ipynb")) - assert len(nb_files) == 1, "Expected only one mom6_bathy notebook file" + nb_files = list(Path("mom6_forge_notebooks").glob(f"mom6_forge_{ocn_grid_name}*.ipynb")) + assert len(nb_files) == 1, "Expected only one mom6_forge notebook file" nb_path = nb_files[0] with open(nb_path, "r") as f: @@ -393,7 +393,7 @@ def construct_custom_res_from_new_mom6_grid_modified_clm_grid(cime): # sleep for a bit to allow the case to be created time.sleep(5) - # remove mom6_bathy notebook belonging to the test_grid: + # remove mom6_forge notebook belonging to the test_grid: os.remove(nb_path) # remove the caseroot directory diff --git a/visualCaseGen/config_vars/grid_vars.py b/visualCaseGen/config_vars/grid_vars.py index 566ec08..901eda7 100644 --- a/visualCaseGen/config_vars/grid_vars.py +++ b/visualCaseGen/config_vars/grid_vars.py @@ -53,7 +53,7 @@ def initialize_custom_grid_variables(cime): ConfigVarInt("OCN_NY") # number of cells in y-direction ConfigVarReal("OCN_LENX") # grid length in x-direction ConfigVarReal("OCN_LENY") # grid length in y-direction - ConfigVarStr('MB_ATTEMPT_ID') # latest mom6_bathy attempt id (auxiliary variable) + ConfigVarStr('MB_ATTEMPT_ID') # latest mom6_forge attempt id (auxiliary variable) ConfigVarStr( "MOM6_BATHY_STATUS", widget_none_val="" ) # a status variable to prevent the completion of the stage diff --git a/visualCaseGen/custom_widget_types/case_creator.py b/visualCaseGen/custom_widget_types/case_creator.py index eefc112..59df06d 100644 --- a/visualCaseGen/custom_widget_types/case_creator.py +++ b/visualCaseGen/custom_widget_types/case_creator.py @@ -9,7 +9,7 @@ import math from ProConPy.config_var import cvars -from visualCaseGen.custom_widget_types.mom6_bathy_launcher import MOM6BathyLauncher +from regional_mom_workflows.CrocoDash.CrocoDash.visualCaseGen.visualCaseGen.custom_widget_types.mom6_forge_launcher import MOM6BathyLauncher from visualCaseGen.custom_widget_types.dummy_output import DummyOutput from visualCaseGen.custom_widget_types.case_tools import xmlchange, run_case_setup, append_user_nl, is_ccs_config_writeable @@ -435,7 +435,7 @@ def _update_component_grids( new_domain, "desc", ) - desc.text = f"New ocean grid {ocn_grid} generated by mom6_bathy" + desc.text = f"New ocean grid {ocn_grid} generated by mom6_forge" if not do_exec: return diff --git a/visualCaseGen/custom_widget_types/mom6_bathy_launcher.py b/visualCaseGen/custom_widget_types/mom6_forge_launcher.py similarity index 86% rename from visualCaseGen/custom_widget_types/mom6_bathy_launcher.py rename to visualCaseGen/custom_widget_types/mom6_forge_launcher.py index 9d5839a..b307a89 100644 --- a/visualCaseGen/custom_widget_types/mom6_bathy_launcher.py +++ b/visualCaseGen/custom_widget_types/mom6_forge_launcher.py @@ -15,15 +15,15 @@ class MOM6BathyLauncher(VBox): - """A widget to create and launch a new mom6_bathy notebook. The widget is enabled when all the - required parameters for mom6_bathy are set.""" + """A widget to create and launch a new mom6_forge notebook. The widget is enabled when all the + required parameters for mom6_forge are set.""" def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) cvars['MB_ATTEMPT_ID'].value = None - self.required_mom6_bathy_vars = [ + self.required_mom6_forge_vars = [ cvars["CUSTOM_GRID_PATH"], cvars["OCN_GRID_MODE"], cvars["OCN_NX"], @@ -35,17 +35,17 @@ def __init__(self, *args, **kwargs): ] # observe changes in the required variables - for var in self.required_mom6_bathy_vars: + for var in self.required_mom6_forge_vars: var._widget.observe(self._on_required_var_change, names="_property_lock", type="change") # Create the main child widgets: Launcg button, Output, and Confirm button - self._btn_launch_mom6_bathy = Button( - description="Launch mom6_bathy", + self._btn_launch_mom6_forge = Button( + description="Launch mom6_forge", button_style="success", layout={"width": "160px", "margin": "10px", "align_self": "center"}, ) - self._btn_launch_mom6_bathy.on_click(self._on_btn_launch_clicked) + self._btn_launch_mom6_forge.on_click(self._on_btn_launch_clicked) self._out = Output() @@ -61,7 +61,7 @@ def __init__(self, *args, **kwargs): self._btn_confirm_completion.on_click(self._on_btn_confirm_completion_clicked) self.children = [ - self._btn_launch_mom6_bathy, + self._btn_launch_mom6_forge, self._out, self._btn_confirm_completion, ] @@ -73,7 +73,7 @@ def disabled(self): @disabled.setter def disabled(self, value): self._out.clear_output() - self._btn_launch_mom6_bathy.disabled = value + self._btn_launch_mom6_forge.disabled = value self._btn_confirm_completion.disabled = value @staticmethod @@ -83,7 +83,7 @@ def get_custom_ocn_grid_path(): return Path(custom_grid_path) / "ocnice" def _on_required_var_change(self, change): - """If any of the required variables are changed, reset the attempt id and mom6_bathy_status.""" + """If any of the required variables are changed, reset the attempt id and mom6_forge_status.""" self._btn_confirm_completion.layout.display = "none" cvars['MB_ATTEMPT_ID'].value = None cvars["MOM6_BATHY_STATUS"].value = None @@ -91,22 +91,22 @@ def _on_required_var_change(self, change): @owh.out.capture() def _on_btn_launch_clicked(self, b): - """Function to launch the mom6_bathy notebook. The function first checks if all the required + """Function to launch the mom6_forge notebook. The function first checks if all the required parameters are set. If not, it displays a warning message. If all required parameters are set, - it generates a new mom6_bathy notebook and opens it in a new tab. The user is then prompted to + it generates a new mom6_forge notebook and opens it in a new tab. The user is then prompted to execute the notebook and confirm completion. Once the notebook is executed, the user can click the "Confirm completion" button to proceed to the next stage.""" - if any(var.value is None for var in self.required_mom6_bathy_vars): + if any(var.value is None for var in self.required_mom6_forge_vars): remaining_params = [ - var.name for var in self.required_mom6_bathy_vars if var.value is None + var.name for var in self.required_mom6_forge_vars if var.value is None ] alert_warning( - f"Please specify all the required parameters before launching mom6_bathy: {remaining_params}" + f"Please specify all the required parameters before launching mom6_forge: {remaining_params}" ) return - # Reset the attempt_id and mom6_bathy_status + # Reset the attempt_id and mom6_forge_status new_attempt_id = str(uuid.uuid1())[:6] cvars['MB_ATTEMPT_ID'].value = new_attempt_id cvars["MOM6_BATHY_STATUS"].value = None @@ -114,17 +114,17 @@ def _on_btn_launch_clicked(self, b): # Determine the path to the new notebook custom_ocn_grid_name = cvars["CUSTOM_OCN_GRID_NAME"].value nb_path = ( - Path("mom6_bathy_notebooks") / f"mom6_bathy_{custom_ocn_grid_name}_{new_attempt_id}.ipynb" + Path("mom6_forge_notebooks") / f"mom6_forge_{custom_ocn_grid_name}_{new_attempt_id}.ipynb" ) - # Launch the mom6_bathy notebook - self._launch_mom6_bathy(nb_path) + # Launch the mom6_forge notebook + self._launch_mom6_forge(nb_path) # Display a message to the user in the output widget with self._out: self._out.clear_output() print( - 'Note: Clicking the "Launch mom6_bathy" button generates a new notebook that ' + 'Note: Clicking the "Launch mom6_forge" button generates a new notebook that ' "should open in a new tab automatically. If not, try manually opening the notebook " f"at the following location: {nb_path}. Follow the instructions and run all cells " 'in the notebook. Once done, click the "Confirm completion" button to proceed.' @@ -135,21 +135,21 @@ def _on_btn_launch_clicked(self, b): @owh.out.capture() def _on_btn_confirm_completion_clicked(self, b): - """Function to confirm completion of mom6_bathy. The function checks if all the required - files are created. If so, it confirms completion of mom6_bathy. If not, it displays a + """Function to confirm completion of mom6_forge. The function checks if all the required + files are created. If so, it confirms completion of mom6_forge. If not, it displays a warning message.""" custom_ocn_grid_path = MOM6BathyLauncher.get_custom_ocn_grid_path() if custom_ocn_grid_path is None: alert_warning( - "No custom_ocn_grid_path found. Cannot confirm completion of mom6_bathy" + "No custom_ocn_grid_path found. Cannot confirm completion of mom6_forge" ) return attempt_id = cvars['MB_ATTEMPT_ID'].value if attempt_id is None: alert_warning( - "No attempt_id found. Cannot confirm completion of mom6_bathy" + "No attempt_id found. Cannot confirm completion of mom6_forge" ) return @@ -157,8 +157,8 @@ def _on_btn_confirm_completion_clicked(self, b): custom_ocn_grid_name = cvars["CUSTOM_OCN_GRID_NAME"].value warning_msg = ( - "Cannot confirm completion of mom6_bathy. Make sure you've executed all " - + "of the cells in the mom6_bathy notebook. The following file is missing: " + "Cannot confirm completion of mom6_forge. Make sure you've executed all " + + "of the cells in the mom6_forge notebook. The following file is missing: " ) # See if all required files are created: @@ -176,23 +176,23 @@ def _on_btn_confirm_completion_clicked(self, b): return # If all files are found, confirm completion - logger.info(f"Confirmed completion of mom6_bathy for {custom_ocn_grid_name}") + logger.info(f"Confirmed completion of mom6_forge for {custom_ocn_grid_name}") cvars["MOM6_BATHY_STATUS"].value = None cvars["MOM6_BATHY_STATUS"].value = "Complete" # Proceed to the next stage Stage.proceed() - def _launch_mom6_bathy(self, nb_filepath): - """Generate a new mom6_bathy notebook and open it in a new tab. This method gets called when - the user clicks the "Launch mom6_bathy" button.""" + def _launch_mom6_forge(self, nb_filepath): + """Generate a new mom6_forge notebook and open it in a new tab. This method gets called when + the user clicks the "Launch mom6_forge" button.""" nb = MOM6BathyLauncher._create_notebook_object() MOM6BathyLauncher._write_notebook(nb, nb_filepath) MOM6BathyLauncher._open_notebook_in_browser(nb_filepath) @staticmethod def _create_notebook_object(): - """Create a mom6_bathy notebook object based on the current values of the required variables. + """Create a mom6_forge notebook object based on the current values of the required variables. Returns ------- @@ -218,18 +218,18 @@ def _create_notebook_object(): nb["cells"] = [ nbf.v4.new_markdown_cell( - "# mom6_bathy\n" + "# mom6_forge\n" "This notebook is auto-generated by visualCaseGen. " "Please review and execute the cells below to create the new MOM6 grid and bathymetry. " "You can modify the cells as needed, unless otherwise noted, to customize the grid " "and bathymetry." ), - nbf.v4.new_markdown_cell("## 1. Import mom6_bathy"), + nbf.v4.new_markdown_cell("## 1. Import mom6_forge"), nbf.v4.new_code_cell( "%%capture\n" - "from mom6_bathy.grid import Grid\n" - "from mom6_bathy.topo import Topo\n" - "from mom6_bathy.vgrid import VGrid" + "from mom6_forge.grid import Grid\n" + "from mom6_forge.topo import Topo\n" + "from mom6_forge.vgrid import VGrid" ), nbf.v4.new_markdown_cell("## 2. Create horizontal grid\n"), ] @@ -260,9 +260,9 @@ def _create_notebook_object(): nb["cells"].extend( [ nbf.v4.new_markdown_cell( - "***mom6_bathy*** provides several idealized bathymetry options and customization " + "***mom6_forge*** provides several idealized bathymetry options and customization " "methods. Below, we show how to specify the simplest bathymetry configuration, a " - "flat bottom. Customize it as you see fit. See mom6_bathy documentation and " + "flat bottom. Customize it as you see fit. See mom6_forge documentation and " "example notebooks on how to create custom bathymetries. " ), nbf.v4.new_code_cell( @@ -288,7 +288,7 @@ def _create_notebook_object(): nbf.v4.new_code_cell( "# Manually modify the bathymetry\n" "%matplotlib ipympl\n" - "from mom6_bathy.topo_editor import TopoEditor\n" + "from mom6_forge.topo_editor import TopoEditor\n" "TopoEditor(topo)" ), ] @@ -349,19 +349,19 @@ def _create_notebook_object(): return nb def _write_notebook(nb, nb_filepath): - """Write the new mom6_bathy notebook to the specified file path. If the directory doesn't + """Write the new mom6_forge notebook to the specified file path. If the directory doesn't exist, it is created. The notebook is then written to the file path.""" os.makedirs(nb_filepath.parent, exist_ok=True) with open(nb_filepath, "w") as f: nbf.write(nb, f) - logger.info(f"Generated a new mom6_bathy notebook at {nb_filepath}") + logger.info(f"Generated a new mom6_forge notebook at {nb_filepath}") return nb_filepath def _open_notebook_in_browser(nb_filepath): - """Open the new mom6_bathy notebook in the browser. This function is called after the notebook + """Open the new mom6_forge notebook in the browser. This function is called after the notebook is generated. It opens the notebook in a new tab in the browser.""" # Open the new notebook in the browser diff --git a/visualCaseGen/custom_widget_types/runoff_mapping_generator.py b/visualCaseGen/custom_widget_types/runoff_mapping_generator.py index b8c7c30..fc5e342 100644 --- a/visualCaseGen/custom_widget_types/runoff_mapping_generator.py +++ b/visualCaseGen/custom_widget_types/runoff_mapping_generator.py @@ -5,14 +5,14 @@ from ProConPy.out_handler import handler as owh from ProConPy.config_var import cvars from ProConPy.dialog import alert_warning -from mom6_bathy import mapping -from visualCaseGen.custom_widget_types.mom6_bathy_launcher import MOM6BathyLauncher +from mom6_forge import mapping +from regional_mom_workflows.CrocoDash.CrocoDash.visualCaseGen.visualCaseGen.custom_widget_types.mom6_forge_launcher import MOM6BathyLauncher class RunoffMappingGenerator(VBox): """Widget to generate runoff to ocean mapping for custom grids. The widget first checks if there exists a standard mapping between the selected runoff grid and the custom ocean grid. If not, it allows the user to generate - a new mapping using the mom6_bathy mapping module. + a new mapping using the mom6_forge mapping module. """ def __init__(self, cime, **kwargs): @@ -29,7 +29,7 @@ def __init__(self, cime, **kwargs): self._btn_generate_new = Button( description="Generate New Map", disabled=False, - tooltip="Generate a new mapping file using the mom6_bathy mapping module.", + tooltip="Generate a new mapping file using the mom6_forge mapping module.", ) self._btn_generate_new.on_click(self.on_btn_generate_new_clicked) diff --git a/visualCaseGen/specs/relational_constraints.py b/visualCaseGen/specs/relational_constraints.py index 4bc3c99..b3b1d78 100644 --- a/visualCaseGen/specs/relational_constraints.py +++ b/visualCaseGen/specs/relational_constraints.py @@ -113,7 +113,7 @@ def get_relational_constraints(cvars): Implies(In(COMP_ATM_OPTION, ["IAF", "NYF"]), ATM_GRID == "T62"): "Core2 forcing can only be used with T62 grid.", - # mom6_bathy-related constraints ------------------ + # mom6_forge-related constraints ------------------ Implies(And(COMP_OCN=="mom", COMP_LND=="slnd", COMP_ICE=="sice"), OCN_LENY<180.0): "If LND and ICE are stub, custom MOM6 grid must exclude poles (singularity).", diff --git a/visualCaseGen/stages/grid_stages.py b/visualCaseGen/stages/grid_stages.py index 4b6db00..4a91294 100644 --- a/visualCaseGen/stages/grid_stages.py +++ b/visualCaseGen/stages/grid_stages.py @@ -9,7 +9,7 @@ from ProConPy.stage import Stage, Guard from ProConPy.out_handler import handler as owh from visualCaseGen.custom_widget_types.stage_widget import StageWidget -from visualCaseGen.custom_widget_types.mom6_bathy_launcher import MOM6BathyLauncher +from regional_mom_workflows.CrocoDash.CrocoDash.visualCaseGen.visualCaseGen.custom_widget_types.mom6_forge_launcher import MOM6BathyLauncher from visualCaseGen.custom_widget_types.clm_modifier_launcher import MeshMaskModifierLauncher, FsurdatModifierLauncher from visualCaseGen.custom_widget_types.runoff_mapping_generator import RunoffMappingGenerator @@ -81,7 +81,7 @@ def initialize_grid_stages(cime): description="You have the option to either use a standard ocean grid or, if you picked " "MOM6 as the ocean model, create a new ocean grid. If you choose to create a new ocean grid, " "you will be prompted to specify the grid extent, resolution, and other parameters. You " - "will then be directed to a new notebook to create the new grid using the mom6_bathy tool.", + "will then be directed to a new notebook to create the new grid using the mom6_forge tool.", widget=StageWidget(VBox), parent=guard_custom_grid, varlist=[cvars["OCN_GRID_MODE"]], @@ -103,7 +103,7 @@ def initialize_grid_stages(cime): stg_new_ocn_grid = Stage( title="Custom Ocean Grid", description="Specify the grid extent, resolution, and other parameters for the new ocean grid. " - "Once all the parameters are specified, the Launch mom6_bathy button will be enabled. Clicking " + "Once all the parameters are specified, the Launch mom6_forge button will be enabled. Clicking " "the button will launch a new notebook. Execute all the cells in the notebook to create the new " "grid. Once all the cells are executed, return to this tab and click the Confirm Completion " "button to proceed to the next stage.", @@ -314,7 +314,7 @@ def initialize_grid_stages(cime): title="Runoff to Ocean Mapping", description="If the ocean model is MOM6, and unless there exists a standard mapping between" "the selected runoff grid and the custom ocean grid, a new mapping must be created using " - "the mom6_bathy mapping module.", + "the mom6_forge mapping module.", widget=StageWidget( VBox, supplementary_widgets=[RunoffMappingGenerator(cime)] diff --git a/visualCaseGen/widgets/grid_widgets.py b/visualCaseGen/widgets/grid_widgets.py index 8698e1c..f471206 100644 --- a/visualCaseGen/widgets/grid_widgets.py +++ b/visualCaseGen/widgets/grid_widgets.py @@ -130,11 +130,11 @@ def initialize_custom_ocn_grid_widgets(): style={"description_width": "250px"}, ) - cv_mom6_bathy_stat = cvars["MOM6_BATHY_STATUS"] - cv_mom6_bathy_stat.widget = DisabledText( + cv_mom6_forge_stat = cvars["MOM6_BATHY_STATUS"] + cv_mom6_forge_stat.widget = DisabledText( value = '', disabled = True, - description="mom6_bathy status:", + description="mom6_forge status:", placeholder = "Incomplete", layout={"width": "300px", "padding": "5px", "align_self": "flex-end"}, style={"description_width": "150px", "background":"lightgray", "text_color":"white"}, From 33b0ff7e0ff3d2d7796bcbbff5c48bb484aa49ec Mon Sep 17 00:00:00 2001 From: manishvenu Date: Thu, 2 Apr 2026 15:18:42 -0600 Subject: [PATCH 08/10] Renamomg bugs --- .../3_system/test_custom_compset_std_grid.py | 2 +- tests/3_system/test_custom_mom6_grid.py | 4 +- tests/3_system/test_f2000_custom_grid.py | 4 +- .../custom_widget_types/case_creator.py | 12 ++--- .../mom6_forge_launcher.py | 54 +++++++++---------- .../runoff_mapping_generator.py | 4 +- visualCaseGen/stages/grid_stages.py | 4 +- 7 files changed, 42 insertions(+), 42 deletions(-) diff --git a/tests/3_system/test_custom_compset_std_grid.py b/tests/3_system/test_custom_compset_std_grid.py index c859a39..93bd177 100755 --- a/tests/3_system/test_custom_compset_std_grid.py +++ b/tests/3_system/test_custom_compset_std_grid.py @@ -16,7 +16,7 @@ from visualCaseGen.initialize_stages import initialize_stages from visualCaseGen.specs.options import set_options from visualCaseGen.specs.relational_constraints import get_relational_constraints -from regional_mom_workflows.CrocoDash.CrocoDash.visualCaseGen.visualCaseGen.custom_widget_types.mom6_forge_launcher import MOM6BathyLauncher +from regional_mom_workflows.CrocoDash.CrocoDash.visualCaseGen.visualCaseGen.custom_widget_types.mom6_forge_launcher import MOM6ForgeLauncher from visualCaseGen.custom_widget_types.case_creator_widget import CaseCreatorWidget from tests.utils import safe_create_case diff --git a/tests/3_system/test_custom_mom6_grid.py b/tests/3_system/test_custom_mom6_grid.py index 865130c..e126ce9 100755 --- a/tests/3_system/test_custom_mom6_grid.py +++ b/tests/3_system/test_custom_mom6_grid.py @@ -16,7 +16,7 @@ from visualCaseGen.initialize_stages import initialize_stages from visualCaseGen.specs.options import set_options from visualCaseGen.specs.relational_constraints import get_relational_constraints -from regional_mom_workflows.CrocoDash.CrocoDash.visualCaseGen.visualCaseGen.custom_widget_types.mom6_forge_launcher import MOM6BathyLauncher +from regional_mom_workflows.CrocoDash.CrocoDash.visualCaseGen.visualCaseGen.custom_widget_types.mom6_forge_launcher import MOM6ForgeLauncher from visualCaseGen.custom_widget_types.case_creator_widget import CaseCreatorWidget from tests.utils import safe_create_case @@ -93,7 +93,7 @@ def test_custom_mom6_grid(): # now launch the mom6_forge notebook mom6_forge_launcher_widget = Stage.active()._widget._main_body.children[-1] - assert isinstance(mom6_forge_launcher_widget, MOM6BathyLauncher) + assert isinstance(mom6_forge_launcher_widget, MOM6ForgeLauncher) # After setting all the required parameters, the launch button should be enabled assert mom6_forge_launcher_widget._btn_launch_mom6_forge.disabled is False diff --git a/tests/3_system/test_f2000_custom_grid.py b/tests/3_system/test_f2000_custom_grid.py index 7104625..8336cbc 100755 --- a/tests/3_system/test_f2000_custom_grid.py +++ b/tests/3_system/test_f2000_custom_grid.py @@ -18,7 +18,7 @@ from visualCaseGen.specs.relational_constraints import get_relational_constraints from visualCaseGen.custom_widget_types.clm_modifier_launcher import MeshMaskModifierLauncher, FsurdatModifierLauncher from visualCaseGen.custom_widget_types.case_creator_widget import CaseCreatorWidget -from regional_mom_workflows.CrocoDash.CrocoDash.visualCaseGen.visualCaseGen.custom_widget_types.mom6_forge_launcher import MOM6BathyLauncher +from regional_mom_workflows.CrocoDash.CrocoDash.visualCaseGen.visualCaseGen.custom_widget_types.mom6_forge_launcher import MOM6ForgeLauncher from tests.utils import safe_create_case @@ -311,7 +311,7 @@ def construct_custom_res_from_new_mom6_grid_modified_clm_grid(cime): # now launch the mom6_forge notebook mom6_forge_launcher_widget = Stage.active()._widget._main_body.children[-1] - assert isinstance(mom6_forge_launcher_widget, MOM6BathyLauncher) + assert isinstance(mom6_forge_launcher_widget, MOM6ForgeLauncher) # After setting all the required parameters, the launch button should be enabled assert mom6_forge_launcher_widget._btn_launch_mom6_forge.disabled is False diff --git a/visualCaseGen/custom_widget_types/case_creator.py b/visualCaseGen/custom_widget_types/case_creator.py index 59df06d..fbe8e0b 100644 --- a/visualCaseGen/custom_widget_types/case_creator.py +++ b/visualCaseGen/custom_widget_types/case_creator.py @@ -9,7 +9,7 @@ import math from ProConPy.config_var import cvars -from regional_mom_workflows.CrocoDash.CrocoDash.visualCaseGen.visualCaseGen.custom_widget_types.mom6_forge_launcher import MOM6BathyLauncher +from visualCaseGen.custom_widget_types.mom6_forge_launcher import MOM6ForgeLauncher from visualCaseGen.custom_widget_types.dummy_output import DummyOutput from visualCaseGen.custom_widget_types.case_tools import xmlchange, run_case_setup, append_user_nl, is_ccs_config_writeable @@ -642,10 +642,10 @@ def _apply_mom_namelist_changes(self, do_exec): ocn_grid_mode == "Create New" ), f"Unknown ocean grid mode: {ocn_grid_mode}" - supergrid_file_path = MOM6BathyLauncher.supergrid_file_path() - topo_file_path = MOM6BathyLauncher.topo_file_path() - vgrid_file_path = MOM6BathyLauncher.vgrid_file_path() - ocn_grid_path = MOM6BathyLauncher.get_custom_ocn_grid_path() + supergrid_file_path = MOM6ForgeLauncher.supergrid_file_path() + topo_file_path = MOM6ForgeLauncher.topo_file_path() + vgrid_file_path = MOM6ForgeLauncher.vgrid_file_path() + ocn_grid_path = MOM6ForgeLauncher.get_custom_ocn_grid_path() # read in min and max depth from the MOM6 topo file: ds_topo = xr.open_dataset(topo_file_path) @@ -752,7 +752,7 @@ def _apply_cice_namelist_changes(self, do_exec): if not comp_ice.startswith("cice"): return - cice_grid_file_path = MOM6BathyLauncher.cice_grid_file_path() + cice_grid_file_path = MOM6ForgeLauncher.cice_grid_file_path() self._apply_user_nl_changes( "cice", [ diff --git a/visualCaseGen/custom_widget_types/mom6_forge_launcher.py b/visualCaseGen/custom_widget_types/mom6_forge_launcher.py index b307a89..fa73ca0 100644 --- a/visualCaseGen/custom_widget_types/mom6_forge_launcher.py +++ b/visualCaseGen/custom_widget_types/mom6_forge_launcher.py @@ -14,7 +14,7 @@ logger = logging.getLogger("\t" + __name__.split(".")[-1]) -class MOM6BathyLauncher(VBox): +class MOM6ForgeLauncher(VBox): """A widget to create and launch a new mom6_forge notebook. The widget is enabled when all the required parameters for mom6_forge are set.""" @@ -139,7 +139,7 @@ def _on_btn_confirm_completion_clicked(self, b): files are created. If so, it confirms completion of mom6_forge. If not, it displays a warning message.""" - custom_ocn_grid_path = MOM6BathyLauncher.get_custom_ocn_grid_path() + custom_ocn_grid_path = MOM6ForgeLauncher.get_custom_ocn_grid_path() if custom_ocn_grid_path is None: alert_warning( "No custom_ocn_grid_path found. Cannot confirm completion of mom6_forge" @@ -162,10 +162,10 @@ def _on_btn_confirm_completion_clicked(self, b): ) # See if all required files are created: - mom6_supergrid_file = MOM6BathyLauncher.supergrid_file_path() - mom6_topog_file = MOM6BathyLauncher.topo_file_path() - esmf_mesh_file = MOM6BathyLauncher.esmf_mesh_file_path() - cice_grid_file = MOM6BathyLauncher.cice_grid_file_path() + mom6_supergrid_file = MOM6ForgeLauncher.supergrid_file_path() + mom6_topog_file = MOM6ForgeLauncher.topo_file_path() + esmf_mesh_file = MOM6ForgeLauncher.esmf_mesh_file_path() + cice_grid_file = MOM6ForgeLauncher.cice_grid_file_path() required_files = [mom6_supergrid_file, mom6_topog_file, esmf_mesh_file] if "CICE" in cvars["COMP_ICE_PHYS"].value: required_files.append(cice_grid_file) @@ -186,9 +186,9 @@ def _on_btn_confirm_completion_clicked(self, b): def _launch_mom6_forge(self, nb_filepath): """Generate a new mom6_forge notebook and open it in a new tab. This method gets called when the user clicks the "Launch mom6_forge" button.""" - nb = MOM6BathyLauncher._create_notebook_object() - MOM6BathyLauncher._write_notebook(nb, nb_filepath) - MOM6BathyLauncher._open_notebook_in_browser(nb_filepath) + nb = MOM6ForgeLauncher._create_notebook_object() + MOM6ForgeLauncher._write_notebook(nb, nb_filepath) + MOM6ForgeLauncher._open_notebook_in_browser(nb_filepath) @staticmethod def _create_notebook_object(): @@ -210,7 +210,7 @@ def _create_notebook_object(): attempt_id = cvars['MB_ATTEMPT_ID'].value # if custom_grid_path doesn't exist, create it: - custom_ocn_grid_path = MOM6BathyLauncher.get_custom_ocn_grid_path() + custom_ocn_grid_path = MOM6ForgeLauncher.get_custom_ocn_grid_path() os.makedirs(custom_ocn_grid_path, exist_ok=True) # Create a new notebook: @@ -314,22 +314,22 @@ def _create_notebook_object(): save_files_cmd = ( "# Do NOT modify this cell!\n\n" "# MOM6 supergrid file.\n" - f'grid.write_supergrid(f"{MOM6BathyLauncher.supergrid_file_path()}")\n\n' + f'grid.write_supergrid(f"{MOM6ForgeLauncher.supergrid_file_path()}")\n\n' "# Save MOM6 topography file:\n" - f'topo.write_topo(f"{MOM6BathyLauncher.topo_file_path()}")\n\n' + f'topo.write_topo(f"{MOM6ForgeLauncher.topo_file_path()}")\n\n' "# Save MOM6 vertical grid file:\n" - f'vgrid.write(f"{MOM6BathyLauncher.vgrid_file_path()}")\n\n' + f'vgrid.write(f"{MOM6ForgeLauncher.vgrid_file_path()}")\n\n' ) if "CICE" in cvars["COMP_ICE_PHYS"].value: save_files_cmd += ( "# CICE grid file:\n" - f'topo.write_cice_grid(f"{MOM6BathyLauncher.cice_grid_file_path()}")\n\n' + f'topo.write_cice_grid(f"{MOM6ForgeLauncher.cice_grid_file_path()}")\n\n' ) save_files_cmd += ( "# Save ESMF mesh file:\n" - f'topo.write_esmf_mesh(f"{MOM6BathyLauncher.esmf_mesh_file_path()}")' + f'topo.write_esmf_mesh(f"{MOM6ForgeLauncher.esmf_mesh_file_path()}")' ) nb["cells"].extend( @@ -396,30 +396,30 @@ def nc_file_suffix(): @staticmethod def supergrid_file_path(): - custom_ocn_grid_path = MOM6BathyLauncher.get_custom_ocn_grid_path() - return custom_ocn_grid_path / f"ocean_hgrid_{MOM6BathyLauncher.nc_file_suffix()}" + custom_ocn_grid_path = MOM6ForgeLauncher.get_custom_ocn_grid_path() + return custom_ocn_grid_path / f"ocean_hgrid_{MOM6ForgeLauncher.nc_file_suffix()}" @staticmethod def topo_file_path(): - custom_ocn_grid_path = MOM6BathyLauncher.get_custom_ocn_grid_path() - return custom_ocn_grid_path / f"ocean_topog_{MOM6BathyLauncher.nc_file_suffix()}" + custom_ocn_grid_path = MOM6ForgeLauncher.get_custom_ocn_grid_path() + return custom_ocn_grid_path / f"ocean_topog_{MOM6ForgeLauncher.nc_file_suffix()}" @staticmethod def vgrid_file_path(): - custom_ocn_grid_path = MOM6BathyLauncher.get_custom_ocn_grid_path() - return custom_ocn_grid_path / f"ocean_vgrid_{MOM6BathyLauncher.nc_file_suffix()}" + custom_ocn_grid_path = MOM6ForgeLauncher.get_custom_ocn_grid_path() + return custom_ocn_grid_path / f"ocean_vgrid_{MOM6ForgeLauncher.nc_file_suffix()}" @staticmethod def scrip_grid_file_path(): - custom_ocn_grid_path = MOM6BathyLauncher.get_custom_ocn_grid_path() - return custom_ocn_grid_path / f"scrip_{MOM6BathyLauncher.nc_file_suffix()}" + custom_ocn_grid_path = MOM6ForgeLauncher.get_custom_ocn_grid_path() + return custom_ocn_grid_path / f"scrip_{MOM6ForgeLauncher.nc_file_suffix()}" @staticmethod def esmf_mesh_file_path(): - custom_ocn_grid_path = MOM6BathyLauncher.get_custom_ocn_grid_path() - return custom_ocn_grid_path / f"ESMF_mesh_{MOM6BathyLauncher.nc_file_suffix()}" + custom_ocn_grid_path = MOM6ForgeLauncher.get_custom_ocn_grid_path() + return custom_ocn_grid_path / f"ESMF_mesh_{MOM6ForgeLauncher.nc_file_suffix()}" @staticmethod def cice_grid_file_path(): - custom_ocn_grid_path = MOM6BathyLauncher.get_custom_ocn_grid_path() - return custom_ocn_grid_path / f"cice_grid_{MOM6BathyLauncher.nc_file_suffix()}" + custom_ocn_grid_path = MOM6ForgeLauncher.get_custom_ocn_grid_path() + return custom_ocn_grid_path / f"cice_grid_{MOM6ForgeLauncher.nc_file_suffix()}" diff --git a/visualCaseGen/custom_widget_types/runoff_mapping_generator.py b/visualCaseGen/custom_widget_types/runoff_mapping_generator.py index fc5e342..c775715 100644 --- a/visualCaseGen/custom_widget_types/runoff_mapping_generator.py +++ b/visualCaseGen/custom_widget_types/runoff_mapping_generator.py @@ -6,7 +6,7 @@ from ProConPy.config_var import cvars from ProConPy.dialog import alert_warning from mom6_forge import mapping -from regional_mom_workflows.CrocoDash.CrocoDash.visualCaseGen.visualCaseGen.custom_widget_types.mom6_forge_launcher import MOM6BathyLauncher +from visualCaseGen.custom_widget_types.mom6_forge_launcher import MOM6ForgeLauncher class RunoffMappingGenerator(VBox): """Widget to generate runoff to ocean mapping for custom grids. @@ -138,7 +138,7 @@ def get_ocn_grid_and_mesh(self): ocn_mesh_path = self.cime.get_mesh_path("ocnice", ocn_grid) case "Create New": ocn_grid = cvars["CUSTOM_OCN_GRID_NAME"].value - ocn_mesh_path = MOM6BathyLauncher.esmf_mesh_file_path() + ocn_mesh_path = MOM6ForgeLauncher.esmf_mesh_file_path() case _: assert False, f"Unsupported OCN_GRID_MODE: {ocn_grid_mode}" diff --git a/visualCaseGen/stages/grid_stages.py b/visualCaseGen/stages/grid_stages.py index 4a91294..1ce32a7 100644 --- a/visualCaseGen/stages/grid_stages.py +++ b/visualCaseGen/stages/grid_stages.py @@ -9,7 +9,7 @@ from ProConPy.stage import Stage, Guard from ProConPy.out_handler import handler as owh from visualCaseGen.custom_widget_types.stage_widget import StageWidget -from regional_mom_workflows.CrocoDash.CrocoDash.visualCaseGen.visualCaseGen.custom_widget_types.mom6_forge_launcher import MOM6BathyLauncher +from visualCaseGen.custom_widget_types.mom6_forge_launcher import MOM6ForgeLauncher from visualCaseGen.custom_widget_types.clm_modifier_launcher import MeshMaskModifierLauncher, FsurdatModifierLauncher from visualCaseGen.custom_widget_types.runoff_mapping_generator import RunoffMappingGenerator @@ -109,7 +109,7 @@ def initialize_grid_stages(cime): "button to proceed to the next stage.", widget=StageWidget( VBox, - supplementary_widgets=[MOM6BathyLauncher()] + supplementary_widgets=[MOM6ForgeLauncher()] ), parent=Guard( title="Custom Ocn Grid", From 8ffa46125b310cd4e95d20fe4d79892f4da6b0cb Mon Sep 17 00:00:00 2001 From: manishvenu Date: Thu, 2 Apr 2026 15:19:31 -0600 Subject: [PATCH 09/10] Bleh --- external/mom6_forge | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external/mom6_forge b/external/mom6_forge index 844b5fb..e4f6652 160000 --- a/external/mom6_forge +++ b/external/mom6_forge @@ -1 +1 @@ -Subproject commit 844b5fb1ae28edc5e64d732e98891d9bbe76b6a5 +Subproject commit e4f665253d1055a8bc3c4f4a397e89bcf4469511 From 3e91cea8573a86c48e60af4dd2669ca62ff29dfa Mon Sep 17 00:00:00 2001 From: manishvenu Date: Thu, 2 Apr 2026 15:21:15 -0600 Subject: [PATCH 10/10] Rename --- tests/3_system/test_custom_compset_std_grid.py | 2 +- tests/3_system/test_custom_mom6_grid.py | 2 +- tests/3_system/test_f2000_custom_grid.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/3_system/test_custom_compset_std_grid.py b/tests/3_system/test_custom_compset_std_grid.py index 93bd177..f91110e 100755 --- a/tests/3_system/test_custom_compset_std_grid.py +++ b/tests/3_system/test_custom_compset_std_grid.py @@ -16,7 +16,7 @@ from visualCaseGen.initialize_stages import initialize_stages from visualCaseGen.specs.options import set_options from visualCaseGen.specs.relational_constraints import get_relational_constraints -from regional_mom_workflows.CrocoDash.CrocoDash.visualCaseGen.visualCaseGen.custom_widget_types.mom6_forge_launcher import MOM6ForgeLauncher +from visualCaseGen.custom_widget_types.mom6_forge_launcher import MOM6ForgeLauncher from visualCaseGen.custom_widget_types.case_creator_widget import CaseCreatorWidget from tests.utils import safe_create_case diff --git a/tests/3_system/test_custom_mom6_grid.py b/tests/3_system/test_custom_mom6_grid.py index e126ce9..1adcbb9 100755 --- a/tests/3_system/test_custom_mom6_grid.py +++ b/tests/3_system/test_custom_mom6_grid.py @@ -16,7 +16,7 @@ from visualCaseGen.initialize_stages import initialize_stages from visualCaseGen.specs.options import set_options from visualCaseGen.specs.relational_constraints import get_relational_constraints -from regional_mom_workflows.CrocoDash.CrocoDash.visualCaseGen.visualCaseGen.custom_widget_types.mom6_forge_launcher import MOM6ForgeLauncher +from visualCaseGen.custom_widget_types.mom6_forge_launcher import MOM6ForgeLauncher from visualCaseGen.custom_widget_types.case_creator_widget import CaseCreatorWidget from tests.utils import safe_create_case diff --git a/tests/3_system/test_f2000_custom_grid.py b/tests/3_system/test_f2000_custom_grid.py index 8336cbc..74fc17d 100755 --- a/tests/3_system/test_f2000_custom_grid.py +++ b/tests/3_system/test_f2000_custom_grid.py @@ -18,7 +18,7 @@ from visualCaseGen.specs.relational_constraints import get_relational_constraints from visualCaseGen.custom_widget_types.clm_modifier_launcher import MeshMaskModifierLauncher, FsurdatModifierLauncher from visualCaseGen.custom_widget_types.case_creator_widget import CaseCreatorWidget -from regional_mom_workflows.CrocoDash.CrocoDash.visualCaseGen.visualCaseGen.custom_widget_types.mom6_forge_launcher import MOM6ForgeLauncher +from visualCaseGen.custom_widget_types.mom6_forge_launcher import MOM6ForgeLauncher from tests.utils import safe_create_case