Skip to content

Commit f472f2a

Browse files
committed
Create pixi task for building docs instead of the makefile
1 parent b80bb88 commit f472f2a

File tree

6 files changed

+389
-61
lines changed

6 files changed

+389
-61
lines changed

doc/Makefile

Lines changed: 0 additions & 20 deletions
This file was deleted.

doc/conf.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@
1111
author = "VITO"
1212
version = "0.16.0"
1313

14-
extensions = [
15-
"sphinx.ext.autodoc",
16-
]
14+
extensions = ["sphinx.ext.autodoc", "sphinx_design"]
1715

1816
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
1917
autodoc_mock_imports = ["numpy"]

doc/index.rst

Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,149 @@ geodynamix
1111

1212
reference/index
1313

14+
Introduction
15+
____________
16+
Geodynamix is a Rust library with Python bindings that can be used for geospatial data processing.
17+
18+
It's main goal is to make working with raster data more ergonomic.
19+
The main difference to other libraries like ``numpy`` in combination with ``rasterio`` is that it is designed to make calculations with rasters without having to worry about the nodata value.
20+
All operations are nodata aware and handle nodata values in a way that makes sense for raster data.
21+
22+
IO support
23+
----------
24+
Geodynamix supports reading and writing raster data. It uses the ``gdal`` library for reading and writing raster data so it supports all the formats that ``gdal`` supports (See the `gdal drivers <https://gdal.org/en/stable/drivers/raster/index.html>`_ list).
25+
26+
.. code-block:: python
27+
:caption: Reading and writing raster data
28+
29+
import geodynamix as gdx
30+
31+
raster = gdx.read("path/to/raster.tif")
32+
gdx.write("path/to/output.tif", raster)
33+
34+
The data type of the internal raster will match the data type of the input raster. If a different data type is desired, it can be specified with the ``dtype`` parameter using the ``read_as`` function. The numpy data types are supported to specify the desired data type.
35+
36+
.. code-block:: python
37+
:caption: Reading raster data with data type conversion
38+
39+
import geodynamix as gdx
40+
import numpy as np
41+
42+
raster = gdx.read_as(np.dtype("int32"), "path/to/raster.tif")
43+
assert raster.dtype == np.dtype("int32")
44+
45+
Operations
46+
----------
47+
Geodynamix support all the basic raster operations like addition, subtraction, multiplication and division.
48+
49+
.. code-block:: python
50+
:caption: Basic raster operations
51+
52+
import geodynamix as gdx
53+
54+
raster1 = gdx.read("path/to/raster1.tif")
55+
raster2 = gdx.read("path/to/raster2.tif")
56+
result = raster1 + raster2
57+
58+
If ``raster1`` or ``raster2`` have a nodata value, the ``result`` will also have a nodata value at the same location.
59+
In all of the examples ``#`` represents the nodata value.
60+
61+
.. grid:: 5
62+
:gutter: 2
63+
:class-container: custom-grid
64+
65+
.. grid-item::
66+
67+
.. table:: raster1
68+
69+
= = =
70+
# 1 2
71+
3 # 5
72+
6 7 #
73+
= = =
74+
75+
.. grid-item::
76+
:child-align: center
77+
78+
.. math::
79+
80+
\Large \textbf{+}
81+
82+
83+
.. grid-item::
84+
85+
.. table:: raster2
86+
87+
= = =
88+
8 7 #
89+
5 # 3
90+
# 1 0
91+
= = =
92+
93+
.. grid-item::
94+
:child-align: center
95+
96+
.. math::
97+
98+
\Large \textbf{=}
99+
100+
.. grid-item::
101+
102+
.. table:: result
103+
104+
= = =
105+
# 8 #
106+
8 # 8
107+
# 8 #
108+
= = =
109+
110+
Multiplication and subtraction behave in the same way. Division is a bit different, it also behaves the same as the other operations except division by zero alsp becomes a nodata value.
111+
112+
.. grid:: 5
113+
:gutter: 2
114+
:class-container: custom-grid
115+
116+
.. grid-item::
117+
118+
.. table:: raster1
119+
120+
= = =
121+
# 2 2
122+
4 # 4
123+
6 6 #
124+
= = =
125+
126+
.. grid-item::
127+
:child-align: center
128+
129+
.. math::
130+
131+
\Large \textbf{/}
132+
133+
134+
.. grid-item::
135+
136+
.. table:: raster2
137+
138+
= = =
139+
2 2 0
140+
2 0 2
141+
0 2 2
142+
= = =
143+
144+
.. grid-item::
145+
:child-align: center
146+
147+
.. math::
148+
149+
\Large \textbf{=}
150+
151+
.. grid-item::
152+
153+
.. table:: result
154+
155+
= = =
156+
# 1 #
157+
2 # 2
158+
# 3 #
159+
= = =

doc/make.bat

Lines changed: 0 additions & 35 deletions
This file was deleted.

0 commit comments

Comments
 (0)