Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add enums GridRegistration and GridType for grid registration and type #3693

Merged
merged 7 commits into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions doc/_templates/autosummary/enums.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{{ fullname | escape | underline }}

.. currentmodule:: {{ module }}

.. autoclass:: {{ objname }}
:members:
:member-order: bysource
16 changes: 14 additions & 2 deletions doc/api/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
-------------
Expand All @@ -205,8 +219,6 @@ Miscellaneous
which
show_versions

.. currentmodule:: pygmt

Datasets
--------

Expand Down
18 changes: 18 additions & 0 deletions pygmt/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Loading