-
Notifications
You must be signed in to change notification settings - Fork 224
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 GridFormat for GMT grid format ID #3449
Merged
Merged
Changes from 13 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
c8c3bb5
Add enums GridID
seisman ea1cc79
Add enums to the API documentation
seisman 77c0ba3
Only set the 'Conventions' attr to 'CF-1.7' for netCDF files
seisman ce3c55c
Change long enum names to shorter ones
seisman 1640e6c
Use short enum names in header.py
seisman dbc6df7
Merge branch 'main' into enums/gridid
seisman 7317b1b
Merge branch 'main' into enums/gridid
seisman ac6239f
Update docs for enums
seisman d55ee92
Fix enum name from GridID to GridFormat
seisman cb5ff63
Merge branch 'main' into enums/gridid
seisman 889d5e4
Fix enum name from GridID to GridFormat
seisman de83cc4
Fix one comment line
seisman cb38a39
Fix GridID to GridFormat in api
seisman ccfd835
Revert changes in docs
seisman b3f4f3f
Revert changes in pygmt/datatypes/header.py
seisman 9fd9b1a
Merge branch 'main' into enums/gridid
seisman 4ddf321
Fix 'depreciated' to 'deprecated'
seisman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
""" | ||
Enumerations for PyGMT. | ||
""" | ||
|
||
from enum import IntEnum | ||
|
||
|
||
class GridFormat(IntEnum): | ||
""" | ||
Enum for the GMT grid format ID. | ||
|
||
These enums are defined in 'gmt_grdio.h'. | ||
""" | ||
|
||
UNKNOWN = 0 #: Unknown grid format | ||
BF = 1 #: GMT native, C-binary format (32-bit float) | ||
BS = 2 #: GMT native, C-binary format (16-bit integer) | ||
RB = 3 #: SUN rasterfile format (8-bit standard) | ||
BB = 4 #: GMT native, C-binary format (8-bit integer) | ||
BM = 5 #: GMT native, C-binary format (bit-mask) | ||
SF = 6 #: Golden Software Surfer format 6 (32-bit float) | ||
CB = 7 #: GMT netCDF format (8-bit integer, depreciated) | ||
CS = 8 #: GMT netCDF format (16-bit integer, depreciated) | ||
CI = 9 #: GMT netCDF format (32-bit integer, depreciated) | ||
CF = 10 #: GMT netCDF format (32-bit float, depreciated) | ||
CD = 11 #: GMT netCDF format (64-bit float, depreciated) | ||
seisman marked this conversation as resolved.
Show resolved
Hide resolved
|
||
RF = 12 #: GEODAS grid format GRD98 (NGDC) | ||
BI = 13 #: GMT native, C-binary format (32-bit integer) | ||
BD = 14 #: GMT native, C-binary format (64-bit float) | ||
NB = 15 #: GMT netCDF format (8-bit integer) | ||
NS = 16 #: GMT netCDF format (16-bit integer) | ||
NI = 17 #: GMT netCDF format (32-bit integer) | ||
NF = 18 #: GMT netCDF format (32-bit float) | ||
ND = 19 #: GMT netCDF format (64-bit float) | ||
SD = 20 #: Golden Software Surfer format 7 (64-bit float, read-only) | ||
AF = 21 #: Atlantic Geoscience Center format AGC (32-bit float) | ||
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) |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#:
is the special way to document attributes, following https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html#directive-autoproperty.