From bef6d7238b188cd0b179631cd0f10c2c52741b52 Mon Sep 17 00:00:00 2001 From: Carolyn Begeman Date: Thu, 26 Sep 2024 09:30:08 -0500 Subject: [PATCH] Update docs and doc strings --- docs/developers_guide/framework/model.md | 4 +++- docs/developers_guide/ocean/api.md | 1 + docs/developers_guide/organization/steps.md | 6 ------ docs/tutorials/dev_add_test_group.md | 5 +---- polaris/ocean/convergence/forward.py | 4 ++++ polaris/ocean/model/ocean_model_step.py | 3 ++- polaris/ocean/tasks/baroclinic_channel/forward.py | 4 ++++ .../ocean/tasks/baroclinic_channel/restart/restart_step.py | 3 +++ polaris/ocean/tasks/internal_wave/forward.py | 2 +- polaris/ocean/tasks/internal_wave/rpe/__init__.py | 3 +++ 10 files changed, 22 insertions(+), 13 deletions(-) diff --git a/docs/developers_guide/framework/model.md b/docs/developers_guide/framework/model.md index c1430aaa7..a407296bd 100644 --- a/docs/developers_guide/framework/model.md +++ b/docs/developers_guide/framework/model.md @@ -20,7 +20,9 @@ method, you can set number of tasks, threads, etc. determined from the `openmp_threads` attributes. These resources need to be set at construction or in the {ref}`dev-step-setup` method (i.e. before calling {ref}`dev-step-run`) so that the polaris framework can ensure that the required resources are -available. +available. If the graph partition file has been constructed prior to the ocean +model step, the path to the graph file should be provided in the +`graph_target` argument to {py:meth}`polaris.ocean.OceanModelStep.__init__()`. (dev-model-yaml-namelists-and-streams)= diff --git a/docs/developers_guide/ocean/api.md b/docs/developers_guide/ocean/api.md index 63c033544..c308eb85f 100644 --- a/docs/developers_guide/ocean/api.md +++ b/docs/developers_guide/ocean/api.md @@ -215,6 +215,7 @@ init.Init init.Init.run + init.Init.setup viz.Viz viz.Viz.run diff --git a/docs/developers_guide/organization/steps.md b/docs/developers_guide/organization/steps.md index 580e6f34d..9fa8c3dba 100644 --- a/docs/developers_guide/organization/steps.md +++ b/docs/developers_guide/organization/steps.md @@ -244,7 +244,6 @@ class SetupMesh(Step): self.add_input_file(filename='mpas_grid.nc', target='dome_varres_grid.nc', database='') - self.add_output_file(filename='graph.info') self.add_output_file(filename='landice_grid.nc') ``` @@ -366,8 +365,6 @@ class Forward(OceanModelStep): self.add_input_file(filename='initial_state.nc', target='../../init/initial_state.nc') - self.add_input_file(filename='graph.info', - target='../../init/culled_graph.info') self.add_yaml_file('polaris.ocean.tasks.baroclinic_channel', 'forward.yaml') @@ -803,9 +800,6 @@ def __init__(self, component, mesh, init): self.add_input_file( filename='forcing_data.nc', work_dir_target=f'{init.path}/init/init_mode_forcing_data.nc') - self.add_input_file( - filename='graph.info', - work_dir_target=f'{mesh_path}/culled_graph.info') ``` (dev-step-input-polaris)= diff --git a/docs/tutorials/dev_add_test_group.md b/docs/tutorials/dev_add_test_group.md index c555e80d5..961663cdb 100644 --- a/docs/tutorials/dev_add_test_group.md +++ b/docs/tutorials/dev_add_test_group.md @@ -1024,8 +1024,7 @@ class Init(Step): self.resolution = resolution - for file in ['base_mesh.nc', 'culled_mesh.nc', 'culled_graph.info', - 'initial_state.nc']: + for file in ['base_mesh.nc', 'culled_mesh.nc', 'initial_state.nc']: self.add_output_file(file) ``` @@ -1286,8 +1285,6 @@ class Forward(OceanModelStep): self.add_input_file(filename='initial_state.nc', target='../init/initial_state.nc') - self.add_input_file(filename='graph.info', - target='../init/culled_graph.info') self.add_output_file(filename='output.nc') ``` diff --git a/polaris/ocean/convergence/forward.py b/polaris/ocean/convergence/forward.py index 975db8d01..68c3c15c9 100644 --- a/polaris/ocean/convergence/forward.py +++ b/polaris/ocean/convergence/forward.py @@ -50,6 +50,10 @@ def __init__(self, component, name, subdir, resolution, mesh, init, A nested dictionary of options and value for each ``config_model`` to replace model config options with new values + graph_target : str, optional + The graph file name (relative to the base work directory). + If none, it will be created. + output_filename : str, optional The output file that will be written out at the end of the forward run diff --git a/polaris/ocean/model/ocean_model_step.py b/polaris/ocean/model/ocean_model_step.py index ea259b024..97b2dd8f5 100644 --- a/polaris/ocean/model/ocean_model_step.py +++ b/polaris/ocean/model/ocean_model_step.py @@ -84,7 +84,8 @@ def __init__(self, component, name, subdir=None, indir=None, ntasks=None, option of the ``[executables]`` config section. graph_target : str, optional - The name of the graph file to partition + The graph file name (relative to the base work directory). + If none, it will be created. """ if graph_target is None: self.make_graph = True diff --git a/polaris/ocean/tasks/baroclinic_channel/forward.py b/polaris/ocean/tasks/baroclinic_channel/forward.py index c05ec76d7..cfb634732 100644 --- a/polaris/ocean/tasks/baroclinic_channel/forward.py +++ b/polaris/ocean/tasks/baroclinic_channel/forward.py @@ -65,6 +65,10 @@ def __init__(self, component, resolution, name='forward', subdir=None, run_time_steps : int, optional Number of time steps to run for + + graph_target : str, optional + The graph file name (relative to the base work directory). + If none, it will be created. """ self.resolution = resolution self.run_time_steps = run_time_steps diff --git a/polaris/ocean/tasks/baroclinic_channel/restart/restart_step.py b/polaris/ocean/tasks/baroclinic_channel/restart/restart_step.py index d7d9a4ba8..e5da568f4 100644 --- a/polaris/ocean/tasks/baroclinic_channel/restart/restart_step.py +++ b/polaris/ocean/tasks/baroclinic_channel/restart/restart_step.py @@ -24,6 +24,9 @@ def __init__(self, component, resolution, name, indir, init): indir : str the directory the step is in, to which ``name`` will be appended + + init: polaris.ocean.tasks.baroclinic_channel.init.Init + the initial state step """ self.resolution = resolution super().__init__(component=component, name=name, indir=indir, ntasks=4, diff --git a/polaris/ocean/tasks/internal_wave/forward.py b/polaris/ocean/tasks/internal_wave/forward.py index 8a9bca75a..37093d4bc 100644 --- a/polaris/ocean/tasks/internal_wave/forward.py +++ b/polaris/ocean/tasks/internal_wave/forward.py @@ -28,7 +28,7 @@ def __init__(self, component, init, name='forward', subdir=None, name : str the name of the task - init : polaris.Step + init : polaris.ocean.tasks.internal_wave.init.Init the initial state step subdir : str, optional diff --git a/polaris/ocean/tasks/internal_wave/rpe/__init__.py b/polaris/ocean/tasks/internal_wave/rpe/__init__.py index 5504bd683..ff65322c3 100644 --- a/polaris/ocean/tasks/internal_wave/rpe/__init__.py +++ b/polaris/ocean/tasks/internal_wave/rpe/__init__.py @@ -13,6 +13,9 @@ class Rpe(Task): ---------- resolution : float The resolution of the test case in km + + init : polaris.ocean.tasks.baroclinic_channel.init.Init + A shared step for creating the initial state """ def __init__(self, component, indir, init, config, vadv_method='standard'):