Skip to content

Commit 769ad2e

Browse files
adamjstewartcalebrob6
authored andcommitted
Docs: reorganize tutorial hierarchy (#2439)
* Docs: redesign tutorial organization * Typo fixes * Try .ipynb links * Add input range * ruff * more fix * Fix filename
1 parent b849ace commit 769ad2e

8 files changed

+86
-342
lines changed

docs/index.rst

+9-17
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,15 @@ torchgeo
1212
user/glossary
1313
user/alternatives
1414

15+
.. toctree::
16+
:maxdepth: 2
17+
:caption: Tutorials
18+
19+
tutorials/getting_started
20+
tutorials/basic_usage
21+
tutorials/case_studies
22+
tutorials/customization
23+
1524
.. toctree::
1625
:maxdepth: 2
1726
:caption: Package Reference
@@ -24,23 +33,6 @@ torchgeo
2433
api/trainers
2534
api/transforms
2635

27-
.. toctree::
28-
:maxdepth: 1
29-
:caption: Tutorials
30-
31-
tutorials/getting_started
32-
tutorials/pytorch
33-
tutorials/geospatial
34-
tutorials/torchgeo
35-
tutorials/contribute_non_geo_dataset
36-
tutorials/custom_raster_dataset
37-
tutorials/contribute_datamodule
38-
tutorials/transforms
39-
tutorials/indices
40-
tutorials/trainers
41-
tutorials/pretrained_weights
42-
tutorials/earth_surface_water
43-
4436
.. toctree::
4537
:maxdepth: 1
4638
:caption: PyTorch Libraries

docs/tutorials/basic_usage.rst

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
Basic Usage
2+
===========
3+
4+
The following tutorials introduce the basic concepts and components of TorchGeo:
5+
6+
* `Transforms <transforms.ipynb>`_: Preprocessing and data augmentation transforms for geospatial data
7+
* `Indices <indices.ipynb>`_: Spectral indices
8+
* `Pretrained Weights <pretrained_weights.ipynb>`_: Models and pretrained weights
9+
* `Lightning Trainers <trainers.ipynb>`_: PyTorch Lightning data modules and trainers
10+
11+
.. toctree::
12+
:hidden:
13+
:maxdepth: 1
14+
15+
transforms
16+
indices
17+
pretrained_weights
18+
trainers

docs/tutorials/case_studies.rst

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
Case Studies
2+
============
3+
4+
The following case studies present end-to-end workflows for common use cases of geospatial machine learning:
5+
6+
* `Earth Surface Water <earth_surface_water.ipynb>`_: A workflow for mapping surface water, including lakes and rivers
7+
8+
Do you have a use case that is missing from this list? Please open a pull request to add tutorials for your own use cases.
9+
10+
.. toctree::
11+
:hidden:
12+
:maxdepth: 1
13+
14+
earth_surface_water

docs/tutorials/contribute_non_geo_dataset.ipynb

+5-1
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,11 @@
259259
"# Create dummy data for all splits and filenames\n",
260260
"for split in splits:\n",
261261
" for filename in image_file_names:\n",
262-
" create_input_image(split, filename)\n",
262+
" create_input_image(\n",
263+
" os.path.join(root_dir, 'image', split, filename),\n",
264+
" (IMG_SIZE, IMG_SIZE),\n",
265+
" range(2**16),\n",
266+
" )\n",
263267
" create_target_images(split, filename.replace('_', '_target_'))\n",
264268
"\n",
265269
"# Zip directory\n",

docs/tutorials/customization.rst

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
Customization
2+
=============
3+
4+
Is TorchGeo missing a dataset or model you need? Would you like to modify the default augmentations for a data module or extend a builtin trainer?
5+
6+
The following tutorials will teach you how to customize TorchGeo to meet your needs:
7+
8+
* `Custom Non-Geospatial Datasets <contribute_non_geo_dataset.ipynb>`_: How to create and contribute a new NonGeoDataset
9+
* `Custom Raster Datasets <custom_raster_dataset.ipynb>`_: How to create a new RasterDataset
10+
* `Custom Data Module <contribute_datamodule.ipynb>`_: How to create and contribute a new DataModule
11+
12+
TorchGeo is a community-driven open source library. If there is a feature missing that you would like to add, please open a pull request to add it. See the ref:`contributing` guidelines to get started.
13+
14+
.. toctree::
15+
:hidden:
16+
:maxdepth: 1
17+
18+
contribute_non_geo_dataset
19+
custom_raster_dataset
20+
contribute_datamodule

0 commit comments

Comments
 (0)