diff --git a/doc/_templates/autosummary/enums.rst b/doc/_templates/autosummary/enums.rst new file mode 100644 index 00000000000..26883239f1b --- /dev/null +++ b/doc/_templates/autosummary/enums.rst @@ -0,0 +1,7 @@ +{{ fullname | escape | underline }} + +.. currentmodule:: {{ module }} + +.. autoclass:: {{ objname }} + :members: + :member-order: bysource diff --git a/doc/api/index.rst b/doc/api/index.rst index 01fac7d7a89..07f76aff217 100644 --- a/doc/api/index.rst +++ b/doc/api/index.rst @@ -195,6 +195,20 @@ Getting metadata from tabular or grid data: info grdinfo +Enums +----- + +.. currentmodule:: pygmt.enums + +.. autosummary:: + :toctree: generated + :nosignatures: + :template: autosummary/enums.rst + + GridRegistration + GridType + +.. currentmodule:: pygmt Miscellaneous ------------- @@ -205,8 +219,6 @@ Miscellaneous which show_versions -.. currentmodule:: pygmt - Datasets -------- diff --git a/pygmt/enums.py b/pygmt/enums.py index 7c0984eccb9..34419a57e06 100644 --- a/pygmt/enums.py +++ b/pygmt/enums.py @@ -37,3 +37,21 @@ class GridFormat(IntEnum): GD = 22 #: Import through GDAL EI = 23 #: ESRI Arc/Info ASCII Grid Interchange format (ASCII integer) EF = 24 #: ESRI Arc/Info ASCII Grid Interchange format (ASCII float) + + +class GridRegistration(IntEnum): + """ + Enum for the grid registration. + """ + + GRIDLINE = 0 #: Gridline registration + PIXEL = 1 #: Pixel registration + + +class GridType(IntEnum): + """ + Enum for the grid type. + """ + + CARTESIAN = 0 #: Cartesian grid + GEOGRAPHIC = 1 #: Geographic grid