Skip to content

Commit d1207f9

Browse files
committed
Update docstrings
1 parent 5ed9282 commit d1207f9

File tree

4 files changed

+84
-33
lines changed

4 files changed

+84
-33
lines changed

polaris/tasks/ocean/barotropic_gyre/__init__.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,16 @@ def __init__(
6262
----------
6363
component : polaris.tasks.ocean.Ocean
6464
The ocean component that this task belongs to
65+
subdir : str
66+
The subdirectory for the task
67+
test_name : str
68+
The name of the test (e.g., 'munk')
69+
boundary_condition : str
70+
The type of boundary condition ('free-slip' or 'no-slip')
71+
config : PolarisConfigParser
72+
The configuration parser for the task
73+
config_filename : str
74+
The name of the configuration file
6575
"""
6676
name = f'{test_name}/{boundary_condition}'
6777
indir = f'{subdir}/{name}'

polaris/tasks/ocean/barotropic_gyre/analysis.py

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,15 @@
1414

1515
class Analysis(OceanIOStep):
1616
"""
17-
A step for analysing the output from the barotropic gyre
18-
test case
17+
A step for analyzing the output from the barotropic gyre test case.
18+
19+
Attributes
20+
----------
21+
boundary_condition : str
22+
The type of boundary condition to use ('free-slip' or 'no-slip').
23+
24+
test_name : str
25+
The name of the test case (e.g., 'munk').
1926
"""
2027

2128
def __init__(
@@ -26,15 +33,21 @@ def __init__(
2633
boundary_condition='free-slip',
2734
):
2835
"""
29-
Create the step
36+
Create the analysis step.
3037
3138
Parameters
3239
----------
3340
component : polaris.Component
34-
The component the step belongs to
41+
The component the step belongs to.
3542
3643
indir : str
37-
the directory the step is in, to which ``name`` will be appended
44+
The directory the step is in, to which ``name`` will be appended.
45+
46+
test_name : str, optional
47+
The name of the test case (default is 'munk').
48+
49+
boundary_condition : str, optional
50+
The type of boundary condition to use (default is 'free-slip').
3851
"""
3952
super().__init__(component=component, name='analysis', indir=indir)
4053
self.add_input_file(
@@ -217,13 +230,23 @@ def exact_solution(
217230
self, ds_mesh, config, loc='Cell', boundary_condition='free slip'
218231
):
219232
"""
220-
Exact solution to the sea surface height for the linearized Munk layer
221-
experiments.
233+
Exact solution to the barotropic streamfunction for the linearized Munk
234+
layer experiments.
222235
223236
Parameters
224237
----------
225238
ds_mesh : xarray.Dataset
226-
Must contain the fields: f'x{loc}', f'y{loc}'
239+
The mesh dataset. Must contain the fields: f'x{loc}', f'y{loc}'.
240+
241+
config : polaris.config.PolarisConfigParser
242+
The configuration options for the test case.
243+
244+
loc : str, optional
245+
The location type ('Cell', 'Vertex', etc.) for which to compute
246+
the solution.
247+
248+
boundary_condition : str, optional
249+
The type of boundary condition to use ('free-slip' or 'no-slip').
227250
"""
228251

229252
logger = self.logger

polaris/tasks/ocean/barotropic_gyre/forward.py

Lines changed: 28 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ class Forward(OceanModelStep):
1414
1515
Attributes
1616
----------
17-
resolution : float
18-
The resolution of the task in km
19-
20-
dt : float
21-
The model time step in seconds
22-
2317
run_time_steps : int or None
2418
Number of time steps to run for
19+
20+
test_name : str
21+
The name of the test case (e.g., 'munk')
22+
23+
boundary_condition : str
24+
The type of boundary condition ('free-slip' or 'no-slip')
2525
"""
2626

2727
def __init__(
@@ -39,41 +39,48 @@ def __init__(
3939
graph_target='graph.info',
4040
):
4141
"""
42-
Create a new task
42+
Create a new Forward step for the barotropic gyre task.
4343
4444
Parameters
4545
----------
4646
component : polaris.Component
47-
The component the step belongs to
47+
The component the step belongs to.
4848
49-
name : str
50-
the name of the task
49+
name : str, optional
50+
The name of the step. Default is 'forward'.
5151
5252
subdir : str, optional
53-
the subdirectory for the step. If neither this nor ``indir``
54-
are provided, the directory is the ``name``
53+
The subdirectory for the step. If neither this nor ``indir``
54+
are provided, the directory is the ``name``.
5555
5656
indir : str, optional
57-
the directory the step is in, to which ``name`` will be appended
57+
The directory the step is in, to which ``name`` will be appended.
58+
59+
test_name : str, optional
60+
The name of the test case (e.g., 'munk'). Default is 'munk'.
61+
62+
boundary_condition : str, optional
63+
The type of boundary condition ('free-slip' or 'no-slip').
64+
Default is 'free-slip'.
5865
5966
ntasks : int, optional
60-
the number of tasks the step would ideally use. If fewer tasks
67+
The number of tasks the step would ideally use. If fewer tasks
6168
are available on the system, the step will run on all available
62-
tasks as long as this is not below ``min_tasks``
69+
tasks as long as this is not below ``min_tasks``.
6370
6471
min_tasks : int, optional
65-
the number of tasks the step requires. If the system has fewer
66-
than this number of tasks, the step will fail
72+
The minimum number of tasks required. If the system has fewer
73+
than this number of tasks, the step will fail.
6774
6875
openmp_threads : int, optional
69-
the number of OpenMP threads the step will use
76+
The number of OpenMP threads the step will use. Default is 1.
7077
71-
run_time_steps : int or None
72-
Number of time steps to run for
78+
run_time_steps : int or None, optional
79+
Number of time steps to run for. If None, uses config default.
7380
7481
graph_target : str, optional
7582
The graph file name (relative to the base work directory).
76-
If none, it will be created.
83+
Default is 'graph.info'.
7784
"""
7885
self.run_time_steps = run_time_steps
7986
self.test_name = test_name

polaris/tasks/ocean/barotropic_gyre/init.py

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,16 @@
1111

1212
class Init(OceanIOStep):
1313
"""
14-
A step for creating a mesh and initial condition for baroclinic channel
15-
tasks
14+
A step for creating a mesh and initial condition for barotropic gyre tasks
1615
1716
Attributes
1817
----------
19-
resolution : float
20-
The resolution of the task in km
18+
name : str
19+
The name of the step
20+
test_name : str
21+
The name of the test case (e.g., 'munk')
22+
boundary_condition : str
23+
The type of boundary condition (e.g., 'free-slip')
2124
"""
2225

2326
def __init__(
@@ -35,6 +38,14 @@ def __init__(
3538
----------
3639
component : polaris.Component
3740
The component the step belongs to
41+
indir : str
42+
The input directory for the step
43+
name : str, optional
44+
The name of the step (default is 'init')
45+
test_name : str, optional
46+
The name of the test case (default is 'munk')
47+
boundary_condition : str, optional
48+
The type of boundary condition (default is 'free-slip')
3849
"""
3950
super().__init__(component=component, name=name, indir=indir)
4051

0 commit comments

Comments
 (0)