Skip to content

Commit 8fab7c3

Browse files
authored
Add enums GridRegistration and GridType for grid registration and type (#3693)
1 parent 387c69f commit 8fab7c3

File tree

3 files changed

+39
-2
lines changed

3 files changed

+39
-2
lines changed

doc/_templates/autosummary/enums.rst

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{{ fullname | escape | underline }}
2+
3+
.. currentmodule:: {{ module }}
4+
5+
.. autoclass:: {{ objname }}
6+
:members:
7+
:member-order: bysource

doc/api/index.rst

+14-2
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,20 @@ Getting metadata from tabular or grid data:
195195
info
196196
grdinfo
197197

198+
Enums
199+
-----
200+
201+
.. currentmodule:: pygmt.enums
202+
203+
.. autosummary::
204+
:toctree: generated
205+
:nosignatures:
206+
:template: autosummary/enums.rst
207+
208+
GridRegistration
209+
GridType
210+
211+
.. currentmodule:: pygmt
198212

199213
Miscellaneous
200214
-------------
@@ -205,8 +219,6 @@ Miscellaneous
205219
which
206220
show_versions
207221

208-
.. currentmodule:: pygmt
209-
210222
Datasets
211223
--------
212224

pygmt/enums.py

+18
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,21 @@ class GridFormat(IntEnum):
3737
GD = 22 #: Import through GDAL
3838
EI = 23 #: ESRI Arc/Info ASCII Grid Interchange format (ASCII integer)
3939
EF = 24 #: ESRI Arc/Info ASCII Grid Interchange format (ASCII float)
40+
41+
42+
class GridRegistration(IntEnum):
43+
"""
44+
Enum for the grid registration.
45+
"""
46+
47+
GRIDLINE = 0 #: Gridline registration
48+
PIXEL = 1 #: Pixel registration
49+
50+
51+
class GridType(IntEnum):
52+
"""
53+
Enum for the grid type.
54+
"""
55+
56+
CARTESIAN = 0 #: Cartesian grid
57+
GEOGRAPHIC = 1 #: Geographic grid

0 commit comments

Comments
 (0)