Skip to content

Commit ace03d8

Browse files
authored
Add a link checker into CI (#1397)
* Update Why Uxarray in Getting Started Overview * Update the rest of Overview file * Address one minor comment * Add link-check into ci.yml * Fix a broken link in advanced plotting notebook * Address review comments * Fix linkcheck errors * Fix remaining linkcheck errors * Set timeout to 20 min
1 parent 7d3b21a commit ace03d8

12 files changed

Lines changed: 98 additions & 36 deletions

File tree

.github/workflows/ci.yml

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,56 @@ jobs:
6262
run: |
6363
conda list
6464
65-
6665
- name: Run Namespace Tests
6766
run: |
6867
python -m pytest test
68+
69+
link-check:
70+
runs-on: ubuntu-latest
71+
defaults:
72+
run:
73+
shell: bash -l {0}
74+
steps:
75+
- name: checkout
76+
uses: actions/checkout@v5.0.0
77+
78+
- name: environment setup
79+
id: link-env-setup
80+
continue-on-error: true
81+
uses: mamba-org/setup-micromamba@0dea6379afdaffa5d528b3d1dabc45da37f443fc # v2
82+
with:
83+
environment-file: ci/docs.yml
84+
cache-environment: true
85+
cache-environment-key: "linkcheck-${{env.TODAY}}"
86+
create-args: >-
87+
python=3.11
88+
89+
- name: retry environment set up if failed
90+
if: steps.link-env-setup.outcome == 'failure'
91+
uses: mamba-org/setup-micromamba@0dea6379afdaffa5d528b3d1dabc45da37f443fc # v2
92+
with:
93+
download-micromamba: false
94+
environment-file: ci/docs.yml
95+
cache-environment: true
96+
cache-environment-key: "linkcheck-${{env.TODAY}}"
97+
create-args: >-
98+
python=3.11
99+
100+
- name: Install uxarray
101+
run: |
102+
python -m pip install . --no-deps
103+
104+
- name: conda list
105+
run: |
106+
conda list
107+
108+
- name: Make docs with linkcheck
109+
uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3
110+
with:
111+
timeout_minutes: 20
112+
max_attempts: 3
113+
command: |
114+
eval "$(micromamba shell hook --shell bash)"
115+
micromamba activate uxarray-docs
116+
cd docs
117+
make linkcheck

docs/api.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,8 @@ Methods
151151
Grid.calculate_total_face_area
152152
Grid.normalize_cartesian_coordinates
153153
Grid.construct_face_centers
154+
Grid.get_ball_tree
155+
Grid.get_kd_tree
154156
Grid.get_spatial_hash
155157
Grid.get_faces_containing_point
156158

docs/conf.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,9 @@ def __getattr__(cls, name):
231231
"parallel-load-ux-with-dask.ipynb",
232232
]
233233

234+
# add links to ignore during link checking
235+
linkcheck_ignore = [r"https://gmao.gsfc.nasa.gov/gmaoftp/*"]
236+
234237

235238
# custom scripts for making a gallery of examples notebooks
236239
def update_gallery(app: Sphinx):

docs/contributing.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,10 @@ However, this guide might still be missing case-specific details; please do
5353
not hesitate to reach out to us to consult any such cases.
5454

5555
.. note::
56-
Much of the information in this guide has been co-opted from the
57-
`GeoCAT <https://geocat.ucar.edu/pages/contributing.html>`_ project and
58-
`Project Pythia <https://projectpythia.org/contributing.html>`_.
56+
Much of the information in this guide has been co-opted from `Project
57+
Pythia <https://projectpythia.org/contributing>`_ and the
58+
`GeoCAT-comp <https://geocat-comp.readthedocs.io/en/stable/contrib.html>`_
59+
project.
5960

6061
1.3. Project-specific Resources
6162
-------------------------------

docs/gallery.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@ workflow-examples:
2222

2323
external-examples:
2424
- title: Unstructured Grid Visualization Cookbook
25-
path: https://projectpythia.org/unstructured-grid-viz-cookbook/README.html
25+
path: https://projectpythia.org/unstructured-grid-viz-cookbook
2626
thumbnail: https://raw.githubusercontent.com/ProjectPythia/projectpythia.github.io/main/portal/_static/images/logos/pythia_logo-blue-btext-twocolor.svg

docs/getting-started/overview.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ grid format, meaning that we encode all supported unstructured grid formats in t
3030
UGRID conventions at the data loading step.
3131

3232
Specifically, our core functionality is built around horizontally Unstructured Grids as
33-
defined by the 2D Flexible Mesh Topology in the UGRID conventions, which can contain
34-
a mix of triangles, quadrilaterals, or other geometric faces. These types of Unstructured
33+
defined by the 2D Flexible Mesh Topology in the UGRID conventions, which can contain a
34+
mix of triangles, quadrilaterals, or other geometric faces. These types of Unstructured
3535
Grids may have structured vertical levels.
3636

3737

docs/tutorials.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ Tutorials & Videos
77

88
Tutorials
99
---------
10-
* `Project Pythia Unstructured Grid Visualization Cookbook <https://projectpythia.org/unstructured-grid-viz-cookbook/README.html>`_
10+
* `Project Pythia Unstructured Grid Visualization Cookbook <https://projectpythia.org/unstructured-grid-viz-cookbook>`_

docs/user-guide/advanced-plotting.ipynb

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,54 +2,63 @@
22
"cells": [
33
{
44
"cell_type": "markdown",
5-
"source": [
6-
"# Advanced Plotting Techniques"
7-
],
5+
"id": "6ed8f179fd52f3ff",
86
"metadata": {
9-
"collapsed": false
7+
"collapsed": false,
8+
"jupyter": {
9+
"outputs_hidden": false
10+
}
1011
},
11-
"id": "6ed8f179fd52f3ff"
12+
"source": [
13+
"# Advanced Plotting Techniques"
14+
]
1215
},
1316
{
1417
"cell_type": "markdown",
18+
"id": "d985f5b59e2e6a27",
19+
"metadata": {
20+
"collapsed": false,
21+
"jupyter": {
22+
"outputs_hidden": false
23+
}
24+
},
1525
"source": [
1626
"```{seealso}\n",
17-
"This section is currently under development. For more information about advanced plotting techniques for unstructured grids, please refer to the [Unstructured Grid Visualuzation Cookbook](https://projectpythia.org/unstructured-grid-viz-cookbook/README.html).\n",
27+
"This section is currently under development. For more information about advanced plotting techniques for unstructured grids, please refer to the [Unstructured Grid Visualization Cookbook](https://projectpythia.org/unstructured-grid-viz-cookbook).\n",
1828
"```"
19-
],
20-
"metadata": {
21-
"collapsed": false
22-
},
23-
"id": "d985f5b59e2e6a27"
29+
]
2430
},
2531
{
2632
"cell_type": "code",
2733
"execution_count": null,
28-
"outputs": [],
29-
"source": [],
34+
"id": "22a8d2939338bdce",
3035
"metadata": {
31-
"collapsed": false
36+
"collapsed": false,
37+
"jupyter": {
38+
"outputs_hidden": false
39+
}
3240
},
33-
"id": "22a8d2939338bdce"
41+
"outputs": [],
42+
"source": []
3443
}
3544
],
3645
"metadata": {
3746
"kernelspec": {
38-
"display_name": "Python 3",
47+
"display_name": "Python 3 (ipykernel)",
3948
"language": "python",
4049
"name": "python3"
4150
},
4251
"language_info": {
4352
"codemirror_mode": {
4453
"name": "ipython",
45-
"version": 2
54+
"version": 3
4655
},
4756
"file_extension": ".py",
4857
"mimetype": "text/x-python",
4958
"name": "python",
5059
"nbconvert_exporter": "python",
5160
"pygments_lexer": "ipython3",
52-
"version": "2.7.6"
61+
"version": "3.13.9"
5362
}
5463
},
5564
"nbformat": 4,

docs/user-guide/data-structures.ipynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323
"source": [
2424
"The core functionality of UXarray revolves around three data structures, which are used for interacting with unstructured grids and the data variables that reside on them.\n",
2525
"\n",
26-
"1. **[`uxarray.Grid`](https://uxarray.readthedocs.io/en/latest/user_api/generated/uxarray.UxDataArray.html)**: Stores the grid representation (i.e. coordinates, connectivity information, etc.)\n",
27-
"2. **[`uxarray.UxDataset`](https://uxarray.readthedocs.io/en/latest/user_api/generated/uxarray.UxDataset.html)**: One or more data variable that resided on a grid.\n",
28-
"3. **[`uxarray.UxDataArray`](https://uxarray.readthedocs.io/en/latest/user_api/generated/uxarray.UxDataArray.html)**: A single data variable that resides on a grid \n"
26+
"1. **[`uxarray.Grid`](https://uxarray.readthedocs.io/en/latest/generated/uxarray.UxDataArray.html)**: Stores the grid representation (i.e. coordinates, connectivity information, etc.)\n",
27+
"2. **[`uxarray.UxDataset`](https://uxarray.readthedocs.io/en/latest/api.html#uxdataset)**: One or more data variable that resided on a grid.\n",
28+
"3. **[`uxarray.UxDataArray`](https://uxarray.readthedocs.io/en/latest/api.html#uxdataarray)**: A single data variable that resides on a grid\n"
2929
]
3030
},
3131
{

docs/user-guide/grid-formats.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ Alfred Wegener Institute, Helmholtz Centre for Polar and Marine Research (AWI),
148148

149149
References
150150
----------
151-
* https://fesom2.readthedocs.io/en/latest/index.html#
151+
* https://fesom2.readthedocs.io/
152152

153153
HEALPix
154154
=======

0 commit comments

Comments
 (0)