Skip to content

Commit 774e892

Browse files
committed
Clean up docs
This commit fixes all warnings in the docs, except for the warning that the modules' docstrings are not included in the documentation. The warning for Base.close() is no longer thrown, but the correct docstrings are not shown in the correct places. This cannot be fixed unless the necessary types are exported from the relevant modules.
1 parent 83a676b commit 774e892

File tree

8 files changed

+42
-36
lines changed

8 files changed

+42
-36
lines changed

docs/src/datahandling.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# `DataHandling`
1+
# [`DataHandling`](@id datahandling_module)
22

33
The `DataHandling` module is responsible for reading data from files and
44
resampling it onto the simulation grid.
@@ -11,7 +11,7 @@ This is no trivial task. Among the challenges:
1111

1212
The `DataHandling` takes the divide-and-conquer approach: the various core tasks
1313
and features and split into other independent modules (chiefly
14-
[`FileReaders`](@ref), and [`Regridders`](@ref)). Such modules can be developed,
14+
[`FileReaders`](@ref file_reader_module), and [`Regridders`](@ref regridder_module) regridder_module). Such modules can be developed,
1515
tested, and extended independently (as long as they maintain a consistent
1616
interface). For instance, if need arises, the `DataHandler` can be used (almost)
1717
directly to process files with a different format from NetCDF.
@@ -47,7 +47,7 @@ the `NCFileReader`.
4747

4848
> This extension is loaded when loading `ClimaCore` and `NCDatasets` are loaded.
4949
> In addition to this, a `Regridder` is needed (which might require importing
50-
> additional packages) - see [`Regridders`](@ref) for more information.
50+
> additional packages) - see [`Regridders`](@ref regridder_module) for more information.
5151
5252
It is possible to pass down keyword arguments to underlying constructors in
5353
`DataHandler` with the `regridder_kwargs` and `file_reader_kwargs`. These have
@@ -65,28 +65,28 @@ Note that, if a non-identity pre-processing function is provided as part of
6565
`file_reader_kwargs`, it will be applied to each input variable before they
6666
are composed.
6767
Composing multiple input variables is currently only supported with the
68-
`InterpolationsRegridder`, not with `TempestRegridder`.
68+
[`InterpolationsRegridder`](@ref interp_regridder), not with [`TempestRegridder`](@ref tempest_regridder).
6969

7070
Sometimes, the time development of a variable is split across multiple NetCDF
7171
files. `DataHandler` knows how to combine them and treat multiple files as if
7272
they were a single one. To use this feature, just pass the list of NetCDF files
7373
(while the file don't have to be sorted, it is good practice to pass them sorted
74-
in ascending order by time).
74+
in ascending order by time).
7575

7676
#### Heuristics to do-what-you-mean
7777

7878
`DataHandler` tries to interpret the files provided and identify if they are
7979
split across variables or along the time dimension. The heuristics implement are
8080
the following:
81-
- When just a file is passed, it is assumed that it contains everything
81+
- When just a file is passed, it is assumed that it contains everything
8282
- When multiple files are passed, `DataHandler` will assume that the files are
8383
split along variables if the number of files is the same the number of
8484
variables, otherwise, it will assume that each file contains all the variables
8585
for a portion of the total time.
8686
- When the above assumption is incorrect, you can pass a list of list of files
8787
that fully specifies variables and times.
8888

89-
For example,
89+
For example,
9090
```julia
9191
data_handler = DataHandling.DataHandler(
9292
["era1980.nc", "era1981.nc"],
@@ -98,9 +98,9 @@ data_handler = DataHandling.DataHandler(
9898

9999
In this case, `DataHandler` will incorrectly assume that `lai_hv` is contained
100100
in `era1980.nc`, and `lai_lv` is in `era1980.nc`. Instead, construct the
101-
`data_handler` by passing a list of lists
101+
`data_handler` by passing a list of lists
102102
```julia
103-
files = ["era1980.nc", "era1981.nc"]
103+
files = ["era1980.nc", "era1981.nc"]
104104
data_handler = DataHandling.DataHandler(
105105
[files, files],
106106
["lai_hv", "lai_lv"],
@@ -163,7 +163,7 @@ file path), which knows how to combine them.
163163
Suppose that the input NetCDF file `era5_example.nc` contains two variables `u`
164164
and `v`, and we care about their sum `u + v` but not their individual values.
165165
We can provide a pointwise composing function to perform the sum, along with
166-
the `InterpolationsRegridder` to produce the data we want, `u + v`.
166+
the [`InterpolationsRegridder`](@ref interp_regridder) to produce the data we want, `u + v`.
167167
The `preprocess_func` passed in `file_reader_kwargs` will be applied to `u`
168168
and to `v` individually, before the composing function is applied. The regridding
169169
is applied after the composing function. `u` and `v` could also come from separate

docs/src/faqs.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
## Is it possible to preprocess the data in `TimeVaryingInput` or `SpaceVaryingInput`, for instance, to remove NaNs or change units?
44

5-
Yes, [`TimeVaryingInput`](@ref) and [`SpaceVaryingInput`](@ref) support this
6-
feature. [`TimeVaryingInput`](@ref) and [`SpaceVaryingInput`](@ref) that read
7-
NetCDF files use [`NCFileReader`](@ref) under the hood. `NCFileReader`s can be
5+
Yes, [`TimeVaryingInput`](@ref timevaryinginput) and [`SpaceVaryingInput`](@ref spacevaryinginput) support this
6+
feature. [`TimeVaryingInput`](@ref timevaryinginput) and [`SpaceVaryingInput`](@ref spacevaryinginput) that read
7+
NetCDF files use [`NCFileReader`](@ref ncfilereaders) under the hood. `NCFileReader`s can be
88
constructed with an optional keyword argument `preprocess_func`, a pointwise
99
function that transforms the data read into something else. `Input`s can be
1010
constructed to pass down this keyword argument. Let us have a look at an

docs/src/filereaders.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# `FileReaders`
1+
# [`FileReaders`](@id file_reader_module)
22

33
Reading files is a common need for most scientific projects. This can come with
44
a series of problems that have to be solved, from performance (accessing can be
@@ -14,7 +14,7 @@ Future extensions might include:
1414
- doing chunked reads;
1515
- async reads.
1616

17-
## `NCFileReaders`
17+
## [`NCFileReaders`](@id ncfilereaders)
1818

1919
> This extension is loaded when loading `NCDatasets`
2020

docs/src/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ is mostly and interface barrier to provide a path for future improvements.
3838
### `Regridders`
3939

4040
`ClimaUtilities` comes with two modules to map rectangular grids two (extruded)
41-
finite spectral elements, `InterpolationsRegridder` and `TempestRegridder`.
41+
finite spectral elements, `InterpolationsRegridder` and [`TempestRegridder`](@ref tempest_regridder).
4242
These modules are primarily used to ingest data and resample it onto the
4343
computational grid.
4444

docs/src/inputs.md

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ describes the types of plants on the surface of the globe. The
66
`SpaceVaringInputs` and `TimeVaryingInputs` modules provide a unified
77
infrastructure to handle all these cases.
88

9-
## `TimeVaryingInputs`
9+
## [`TimeVaryingInputs`](@id timevaryinginput)
1010

1111
> This extension is loaded when loading `ClimaCore` is loaded. In addition to
1212
> this, if NetCDF files are used, `NCDatasets` has to be loaded too. Finally, a
@@ -21,9 +21,9 @@ developers to update their `Field`s.
2121
This example shows that `TimeVaryingInput` can take different types of inputs
2222
and be used with a single interface (`evaluate!`). In all of this,
2323
`TimeVaryingInput`s internally handle all the complexity related to reading
24-
files (using [`FileReaders`](@ref)), dealing with parallelism and GPUs,
25-
regridding onto the computational domains (using [`Regridders`](@ref) and
26-
[`DataHandling`](@ref)), and so on.
24+
files (using [`FileReaders`](@ref file_reader_module)), dealing with parallelism and GPUs,
25+
regridding onto the computational domains (using [`Regridders`](@ref regridder_module) and
26+
[`DataHandling`](@ref datahandling_module)), and so on.
2727

2828
`TimeVaryingInputs` support:
2929
- analytic functions of time;
@@ -53,7 +53,7 @@ All input variables to be composed together must have the same spatial and
5353
temporal dimensions.
5454

5555
Composing multiple input variables is currently only supported with the
56-
`InterpolationsRegridder`, not with `TempestRegridder`. The regridding
56+
[`InterpolationsRegridder`](@ref interp_regridder), not with [`TempestRegridder`](@ref tempest_regridder). The regridding
5757
is applied after the pre-processing and composing.
5858

5959
Composing multiple input variables in one `Input` is also possible with
@@ -64,7 +64,7 @@ a `SpaceVaryingInput`, and everything mentioned here applies in that case.
6464
Suppose that the input NetCDF file `era5_example.nc` contains two variables `u`
6565
and `v`, and we care about their sum `u + v` but not their individual values.
6666
We can provide a pointwise composing function to perform the sum, along with
67-
the `InterpolationsRegridder` to produce the data we want, `u + v`.
67+
the [`InterpolationsRegridder`](@ref interp_regridder) to produce the data we want, `u + v`.
6868
The `preprocess_func` passed in `file_reader_kwargs` will be applied to `u`
6969
and to `v` individually, before the composing function is applied. The regridding
7070
is applied after the composing function. `u` and `v` could also come from separate
@@ -109,7 +109,7 @@ timevaryinginput = TimeVaryingInputs.TimeVaryingInput(["era5_1980.nc", "era5_198
109109

110110
This capability is only available for the `InterpolationsRegridder`.
111111

112-
Read more about this feature in the page about [`DataHandler`](@ref).
112+
Read more about this feature in the page about [`DataHandler`](@ref datahandling_module).
113113

114114
### Extrapolation boundary conditions
115115

@@ -213,23 +213,24 @@ albedo_tv = TimeVaryingInputs.TimeVaryingInput("cesem_albedo.nc", "alb", target_
213213

214214
!!! note
215215

216-
In this example we used the [`TempestRegridder`](@ref). This is not the best
217-
choice in most cases because the [`TempestRegridder`](@ref) is slower, and
216+
In this example we used the [`TempestRegridder`](@ref tempest_regridder).
217+
This is not the best
218+
choice in most cases because the [`TempestRegridder`](@ref tempest_regridder) is slower, and
218219
not well-compatible with MPI and GPUs (`ClimaUtilities` implements
219220
workarounds for this, so the code would still work).
220-
[`InterpolationsRegridder`](@ref) should be preferred, unless there is a
221-
strict requirement of conservation: while [`TempestRegridder`](@ref) is
222-
guaranteed to conserve various properties, [`InterpolationsRegridder`](@ref)
221+
[`InterpolationsRegridder`](@ref interp_regridder) should be preferred, unless there is a
222+
strict requirement of conservation: while [`TempestRegridder`](@ref tempest_regridder) is
223+
guaranteed to conserve various properties, [`InterpolationsRegridder`](@ref interp_regridder)
223224
is not.
224225

225-
## `SpaceVaryingInputs`
226+
## [`SpaceVaryingInputs`](@id spacevaryinginput)
226227

227228
> This extension is loaded when loading `ClimaCore` is loaded. In addition to
228229
> this, if NetCDF files are used, `NCDatasets` has to be loaded too. Finally, a
229230
> `Regridder` is needed (which might require importing additional packages).
230231
231232
`SpaceVaryingInput`s uses the same building blocks as `TimeVaryingInput`
232-
(chiefly the [`DataHandling`](@ref) module) to construct a `Field` from
233+
(chiefly the [`DataHandling`](@ref datahandling_module) datahandling_module) to construct a `Field` from
233234
different sources.
234235

235236
`SpaceVaryingInputs` support:
@@ -246,7 +247,7 @@ be a named tuple or a dictionary that maps `Symbol`s to values.
246247

247248
`SpaceVaryingInputs` support reading individual input variables from NetCDF files,
248249
as well as composing multiple input variables into one `SpaceVaryingInput`.
249-
See the [`TimeVaryingInput`](@ref) "NetCDF file inputs" section for more
250+
See the [`TimeVaryingInput`](@ref timevaryinginput) "NetCDF file inputs" section for more
250251
information about this feature.
251252

252253
### Example
@@ -284,5 +285,6 @@ ClimaUtilities.TimeVaryingInputs.Flat
284285
ClimaUtilities.TimeVaryingInputs.evaluate!
285286
ClimaUtilities.TimeVaryingInputs.extrapolation_bc
286287
Base.in
287-
Base.close
288+
Base.close(::ClimaUtilities.TimeVaryingInputs.AbstractTimeVaryingInput)
289+
288290
```

docs/src/onlinelogging.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ about current step, simulation time, and average performance. With
2424

2525
`WallTimeInfo` is a struct that holds information about wall time (the time you
2626
see on your watch, not the simulation time) and that can be used to report
27-
timing information with [`report_walltime`](@ref).
27+
timing information with [`report_walltime`](@ref ClimaUtilities.OnlineLogging.report_walltime).
2828

2929
`WallTimeInfo` keeps track and accumulates how much time has elapsed since the
3030
last time it was updated. In this, `WallTimeInfo` tries to automatically remove

docs/src/regridders.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Regridders
1+
# [`Regridders`](@id regridder_module)
22

33
Simulations often need to import external data directly onto the computational
44
grid. The `Regridders` module implements different schemes to accomplish this
@@ -27,7 +27,7 @@ If a regridder type is not specified by the user, and multiple are available,
2727
the `InterpolationsRegridder` will be used by default. At least one regridder
2828
extension must be loaded to be able to use regridding.
2929

30-
## `TempestRegridder`
30+
## [`TempestRegridder`](@id tempest_regridder)
3131

3232
> This extension is loaded when loading `ClimaCoreTempestRemap`
3333
@@ -57,7 +57,7 @@ reg = Regridders.TempestRegridder(target_space, "regrid_output", "u", "era5_exam
5757
regridded_u = Regridders.regrid(reg, target_date)
5858
```
5959

60-
## `InterpolationsRegridder`
60+
## [`InterpolationsRegridder`](@id interp_regridder)
6161

6262
> This extension is loaded when loading `ClimaCore` and `Interpolations`
6363

src/TimeManager.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,11 @@ datetime_to_strdate(datetime::Dates.DateTime) =
6767
string(lpad(Dates.day(datetime), 2, "0"))
6868

6969
abstract type AbstractFrequency end
70+
71+
"Struct used to dispatch callback that is triggered monthly"
7072
struct Monthly <: AbstractFrequency end
73+
74+
"Struct used to dispatch callback that is triggered every timestep"
7175
struct EveryTimestep <: AbstractFrequency end
7276

7377
"""

0 commit comments

Comments
 (0)