Skip to content

Commit 135349e

Browse files
authored
Merge pull request #102 from xylar/fix-docs
Several fixes to the docs following recent expansion
2 parents 0b01221 + 3c15ae4 commit 135349e

29 files changed

+108
-28
lines changed

Diff for: docs/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
/generated
22
/_build
3+
/developer_guide/generated

Diff for: docs/_templates/layout.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@
2323
</script>
2424

2525
<!-- Load version switcher JS -->
26-
<script src="{{ pathto("shared/version-switcher.js", True) }}"></script>
26+
<script src="../shared/version-switcher.js"></script>
2727

2828
{% endblock %}

Diff for: docs/conf.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
'sphinx.ext.napoleon'
3535
]
3636

37-
autosummary_generate = ['api.md']
37+
autosummary_generate = ['developer_guide/api.md']
3838

3939
# Otherwise, the Return parameter list looks different from the Parameters list
4040
napoleon_use_rtype = False

Diff for: docs/developer_guide/api.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# API reference
2-
3-
:index:
2+
```{index} single: API reference
3+
```
44

55
This page provides an auto-generated summary of the pyremap API.
66

Diff for: docs/developer_guide/contribution_workflow.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
# Contribution Workflow
2+
```{index} single: Contribution Workflow
3+
```
24

35
This document outlines the workflow for contributing to `pyremap`.
46

Diff for: docs/developer_guide/generate_preview_docs.md

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Generating and Previewing Documentation
2+
```{index} single: Documentation; Generating and Previewing
3+
```
4+
5+
This guide explains how to build and preview the documentation for `pyremap`.
6+
7+
## Prerequisites
8+
9+
Ensure you have the following installed:
10+
- [Miniforge](https://github.com/conda-forge/miniforge) or [Micromamba](https://mamba.readthedocs.io/en/latest/user_guide/micromamba.html)
11+
- The required dependencies listed in `dev-spec.txt`:
12+
```bash
13+
conda create -n pyremap_dev --file dev-spec.txt
14+
conda activate pyremap_dev
15+
python -m pip install --no-deps --no-build-isolation -e .
16+
```
17+
18+
## Building the Documentation
19+
20+
To build the documentation, run the following command:
21+
```bash
22+
cd docs
23+
DOC_VERSION=main make versioned-html
24+
```
25+
This will generate the static site in the `_build/html/main` directory.
26+
27+
## Previewing the Documentation
28+
29+
To preview the documentation locally, open the `index.html` file in the `_build/html/main` directory with your browser or try:
30+
```bash
31+
cd _build/html
32+
python -m http.server 8000
33+
```
34+
Then, open http://0.0.0.0:8000/main/ in your browser.
35+
36+
## Notes
37+
38+
- Make sure all documentation changes are committed before building or previewing.
39+
- Verify the formatting and content in the generated HTML files before submitting changes.

Diff for: docs/developer_guide/index.md

+10-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Developer Guide
2-
3-
:index:
2+
```{index} single: Developer Guide
3+
```
44

55
Welcome to the Developer Guide for `pyremap`. This section provides resources and guidelines for contributors.
66

@@ -31,6 +31,11 @@ Welcome to the Developer Guide for `pyremap`. This section provides resources an
3131

3232
## Additional Resources
3333

34-
- [API Reference](api.md)
35-
- [Testing Instructions](testing_instructions.md)
36-
- [Contribution Workflow](contribution_workflow.md)
34+
```{toctree}
35+
:maxdepth: 2
36+
37+
contribution_workflow
38+
testing_instructions
39+
generate_preview_docs
40+
api
41+
```

Diff for: docs/developer_guide/testing_instructions.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
# Testing Instructions
2+
```{index} single: Testing Instructions
3+
```
24

35
This document provides detailed instructions for testing `pyremap`.
46

Diff for: docs/examples/index.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
# Examples
2+
```{index} single: Examples
3+
```
24

35
Detailed walkthroughs of example scripts.
46

Diff for: docs/examples/make_mpas_to_antarctic_stereo_mapping.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Make MPAS to Antarctic Stereo Mapping
2-
3-
:index:
2+
```{index} single: Examples; MPAS to Antarctic Stereo
3+
```
44

55
This example demonstrates how to create a mapping file from an MPAS mesh to an Antarctic stereographic grid.
66

Diff for: docs/examples/make_mpas_to_lat_lon_mapping.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
# Make MPAS to Lat-Lon Mapping
2+
```{index} single: Examples; MPAS to Lat-Lon
3+
```
24

35
This example demonstrates how to create a mapping file from an MPAS cell mesh
46
to a regular latitude-longitude grid.

Diff for: docs/examples/make_mpas_vertex_to_antarctic_stereo_mapping.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Make MPAS Vertex to Antarctic Stereo Mapping
2-
3-
:index:
2+
```{index} single: Examples; MPAS Vertex to Antarctic Stereo
3+
```
44

55
This example demonstrates how to create a mapping file from MPAS mesh vertices to an Antarctic stereographic grid.
66

Diff for: docs/index.md

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
![pyremap logo](../_static/logo.png)
1+
![pyremap logo](_static/logo.png)
22
=(pyremap)
33

44
# pyremap
55

66
Python remapping tools for climate and earth system models.
77

88
## Introduction
9-
:index:
9+
```{index} single: Introduction
10+
```
1011

1112
`pyremap` is a Python library designed to facilitate the remapping
1213
(interpolation) of data between different spatial representations, such as
@@ -36,7 +37,8 @@ custom spatial datasets, `pyremap` provides the tools you need to perform
3637
accurate and efficient remapping.
3738

3839
## Documentation Overview
39-
:index:
40+
```{index} single: Documentation; Overview
41+
```
4042

4143
This documentation is organized into the following sections:
4244

@@ -59,6 +61,7 @@ developer_guide/index
5961
- **Developer Guide**: Resources for contributors, including API references, testing instructions, contribution guidelines, and coding standards.
6062

6163
# Indices and tables
62-
:index:
64+
```{index} single: Indices and tables
65+
```
6366

6467
* {ref}`genindex`

Diff for: docs/mesh_descriptors/index.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Mesh Descriptors
2-
3-
:index:
2+
```{index} single: Mesh Descriptors
3+
```
44

55
Overview of mesh descriptors used in pyremap.
66

Diff for: docs/mesh_descriptors/lat_lon_2d_grid_descriptor.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
# LatLon2DGridDescriptor
2+
```{index} single: Mesh Descriptors; LatLon2DGridDescriptor
3+
```
24

35
A descriptor for 2D latitude-longitude grids.
46

Diff for: docs/mesh_descriptors/lat_lon_grid_descriptor.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
# LatLonGridDescriptor
2+
```{index} single: Mesh Descriptors; LatLonGridDescriptor
3+
```
24

35
A descriptor for latitude-longitude grids.
46

Diff for: docs/mesh_descriptors/mpas_cell_mesh_descriptor.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
# MpasCellMeshDescriptor
2+
```{index} single: Mesh Descriptors; MpasCellMeshDescriptor
3+
```
24

35
A descriptor for MPAS cell meshes.
46

Diff for: docs/mesh_descriptors/mpas_edge_mesh_descriptor.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
# MpasEdgeMeshDescriptor
2+
```{index} single: Mesh Descriptors; MpasEdgeMeshDescriptor
3+
```
24

35
A descriptor for MPAS edge meshes.
46

Diff for: docs/mesh_descriptors/mpas_vertex_mesh_descriptor.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
# MpasVertexMeshDescriptor
2+
```{index} single: Mesh Descriptors; MpasVertexMeshDescriptor
3+
```
24

35
A descriptor for MPAS vertex meshes.
46

Diff for: docs/mesh_descriptors/point_collection_descriptor.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
# PointCollectionDescriptor
2+
```{index} single: Mesh Descriptors; PointCollectionDescriptor
3+
```
24

35
A descriptor for a collection of points.
46

Diff for: docs/mesh_descriptors/projection_grid_descriptor.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
# ProjectionGridDescriptor
2+
```{index} single: Mesh Descriptors; ProjectionGridDescriptor
3+
```
24

35
A descriptor for grids based on map projections.
46

Diff for: docs/polar_projections/index.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Polar Projections
2-
3-
:index:
2+
```{index} single: Polar Projections
3+
```
44

55
This is a set of functions used to support polar projections from `pyproj` and associated mesh descriptors.
66

Diff for: docs/quick_start.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,4 @@ remapper.ncremap(
5353

5454
## Additional Resources
5555

56-
For more detailed examples and advanced usage, refer to the [documentation]({ref}`pyremap`).
56+
For more detailed examples and advanced usage, refer to the [documentation](index.md#pyremap).

Diff for: docs/remapper/building_mapping.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
# Building the Mapping
2+
```{index} single: Remapper; Building the Mapping
3+
```
24

35
How to build the mapping file for remapping.
46

Diff for: docs/remapper/destination_grid_setup.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
# Destination Grid Setup
2+
```{index} single: Remapper; Destination Grid Setup
3+
```
24

35
How to set up the destination grid for remapping.
46

Diff for: docs/remapper/index.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Remapper
2-
3-
:index:
2+
```{index} single: Remapper
3+
```
44

55
Overview of the remapping process in pyremap.
66

Diff for: docs/remapper/remapping_data.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
# Remapping Data
2+
```{index} single: Remapper; Remapping Data
3+
```
24

35
How to remap data using the generated mapping file.
46

Diff for: docs/remapper/smoothing.md

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
### Smoothing with `expand_dist` and `expand_factor`
1+
# Smoothing with `expand_dist` and `expand_factor`
2+
```{index} single: Remapper; Smoothing
3+
```
24

35
`pyremap` provides a unique capability for controlled smoothing when writing out the destination mesh descriptor. This is achieved through the use of two optional attributes: `expand_dist` and `expand_factor`. These attributes can be specified either as part of the destination descriptor or as attributes of the `remapper`, which will then pass them along to the destination descriptor.
46

5-
#### Attributes Overview
7+
## Attributes Overview
68

79
- **`expand_dist`**:
810
Specifies a distance in meters by which each grid cell is expanded. This can be provided as:
@@ -16,11 +18,11 @@
1618

1719
> **Note**: The default values are `expand_dist = 0.0` and `expand_factor = 1.0`, which result in no smoothing.
1820
19-
#### Usage and Behavior
21+
## Usage and Behavior
2022

2123
These attributes are particularly useful for producing highly controlled smoothing as part of the remapping process. By expanding grid cells either by a fixed distance (`expand_dist`) or by a fraction of their size (`expand_factor`), users can fine-tune the smoothing effect to meet specific requirements.
2224

23-
#### Important Notes
25+
## Important Notes
2426

2527
1. **Combination with the `conserve` Method**:
2628
The `expand_dist` and `expand_factor` attributes must be used in combination with the `conserve` remapping method. This is because they leverage the area-weighted interpolation mechanism inherent to this method.

Diff for: docs/remapper/source_grid_setup.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
# Source Grid Setup
2+
```{index} single: Remapper; Source Grid Setup
3+
```
24

35
How to set up the source grid for remapping.
46

0 commit comments

Comments
 (0)