GeezerVison is showing github.com — Merge branch 'main' into ctypesarray · GenericMappingTools/pygmt@09ac0a0
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: doc/_static/style.css +4Lines changed: 4 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -219,3 +219,7 @@ th.text-center, td.text-center { | 219 | 219 | th.text-right, td.text-right { | 220 | 220 | text-align: right !important; | 221 | 221 | } | | 222 | + | | 223 | +.std-term { | | 224 | + font-weight: 600; | | 225 | +} |
Collapse file Copy file name to clipboardExpand all lines: doc/install.md +4-4Lines changed: 4 additions & 4 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -269,17 +269,17 @@ problems and solutions. | 269 | 269 | Sometimes, PyGMT will be unable to find the correct version of the GMT shared library | 270 | 270 | (`libgmt`). This can happen if you have multiple versions of GMT installed. | 271 | 271 |
| 272 | | -You can tell PyGMT exactly where to look for `libgmt` by setting the `GMT_LIBRARY_PATH` | 273 | | -environment variable to the directory where `libgmt.so`, `libgmt.dylib` or `gmt.dll` can | 274 | | -be found on Linux, macOS or Windows, respectively. | | 272 | +You can tell PyGMT exactly where to look for `libgmt` by setting the environment | | 273 | +variable {term}`GMT_LIBRARY_PATH` to the directory where `libgmt.so`, `libgmt.dylib` or | | 274 | +`gmt.dll` can be found on Linux, macOS or Windows, respectively. | 275 | 275 |
| 276 | 276 | For Linux/macOS, add the following line to your shell configuration file (usually | 277 | 277 | `~/.bashrc` for Bash on Linux and `~/.zshrc` for Zsh on macOS): | 278 | 278 | ``` | 279 | 279 | export GMT_LIBRARY_PATH=$HOME/miniforge3/envs/pygmt/lib | 280 | 280 | ``` | 281 | 281 |
| 282 | | -For Windows, add the `GMT_LIBRARY_PATH` environment variable following these | | 282 | +For Windows, add the environment variable {term}`GMT_LIBRARY_PATH` following these | 283 | 283 | [instructions](https://www.wikihow.com/Create-an-Environment-Variable-in-Windows-10) | 284 | 284 | and set its value to a path like: | 285 | 285 | ``` | |
Collapse file Copy file name to clipboard +46Lines changed: 46 additions & 0 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +# Environment Variables | | 2 | + | | 3 | +PyGMT's behavior can be controlled through various environment variables. These variables | | 4 | +can be set either in your shell environment or within your Python script using the | | 5 | +{py:data}`os.environ` dictionary. | | 6 | + | | 7 | +Here we list the environment variables used by PyGMT which are categorized into three groups: | | 8 | + | | 9 | +1. System environment variables | | 10 | +2. GMT/PyGMT environment variables | | 11 | +3. Module-specific environment variables | | 12 | + | | 13 | +## System Environment Variables | | 14 | + | | 15 | +```{glossary} | | 16 | +TZ | | 17 | + Specify the time zone for the current calendar time. It can be set to a string that | | 18 | + defines the timezone, such as `"UTC"`, `"America/New_York"`, or `"Europe/London"`. | | 19 | + Refer to [Specifying the Time Zone with TZ](https://www.gnu.org/software/libc/manual/html_node/TZ-Variable.html) | | 20 | + for the valid format. If not set, the system's default timezone is used. | | 21 | +``` | | 22 | + | | 23 | +## GMT/PyGMT Environment Variables | | 24 | + | | 25 | +```{glossary} | | 26 | +GMT_LIBRARY_PATH | | 27 | + Specify the directory where the GMT shared library is located. This is useful when | | 28 | + GMT is installed in a non-standard location or when you want to use a specific | | 29 | + version of GMT. If not set, PyGMT will attempt to find the GMT library in standard | | 30 | + system locations. | | 31 | +
| | 32 | +PYGMT_USE_EXTERNAL_DISPLAY | | 33 | + Whether to use external viewers for displaying images. If set to `"false"`, PyGMT | | 34 | + will not attempt to open images in external viewers. This can be useful when running | | 35 | + tests or building the documentation to avoid popping up windows. | | 36 | +``` | | 37 | + | | 38 | +## Module-Specific Environment Variables | | 39 | + | | 40 | +```{glossary} | | 41 | +X2SYS_HOME | | 42 | + Specify the directory where x2sys databases and related settings will be stored. | | 43 | + This environment variable is used by x2sys-related functions (e.g., | | 44 | + {func}`pygmt.x2sys_init`) to manage and access x2sys data. If not set, these | | 45 | + functions will use a default directory or prompt for a location. | | 46 | +``` |
Collapse file Copy file name to clipboardExpand all lines: doc/techref/index.md +1Lines changed: 1 addition & 0 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -11,4 +11,5 @@ visit the {gmt-docs}`GMT Technical Reference <reference.html>`. | 11 | 11 | projections.md | 12 | 12 | fonts.md | 13 | 13 | encodings.md | | 14 | +environment_variables | 14 | 15 | ``` |
Collapse file Copy file name to clipboardExpand all lines: pygmt/clib/loading.py +4-4Lines changed: 4 additions & 4 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 2 | 2 | Utility functions to load libgmt as ctypes.CDLL. | 3 | 3 |
| 4 | 4 | The path to the shared library can be found automatically by ctypes or set through the | 5 | | -GMT_LIBRARY_PATH environment variable. | | 5 | +environment variable :term:`GMT_LIBRARY_PATH`. | 6 | 6 | """ | 7 | 7 |
| 8 | 8 | import ctypes | @@ -128,9 +128,9 @@ def clib_full_names(env: Mapping | None = None) -> Iterator[str]: | 128 | 128 |
| 129 | 129 | The GMT shared library is searched for in following ways, sorted by priority: | 130 | 130 |
| 131 | | - 1. Path defined by environmental variable GMT_LIBRARY_PATH | 132 | | - 2. Path returned by command "gmt --show-library" | 133 | | - 3. Path defined by environmental variable PATH (Windows only) | | 131 | + 1. Path defined by the environment variable :term:`GMT_LIBRARY_PATH` | | 132 | + 2. Path returned by the command "gmt --show-library" | | 133 | + 3. Path defined by the environment variable PATH (Windows only) | 134 | 134 | 4. System default search path | 135 | 135 |
| 136 | 136 | Parameters | |
Collapse file Copy file name to clipboardExpand all lines: pygmt/clib/session.py +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -116,7 +116,7 @@ class Session: | 116 | 116 | same ``with`` block as the API calls that will use the data. | 117 | 117 |
| 118 | 118 | By default, will let :mod:`ctypes` try to find the GMT shared library | 119 | | - (``libgmt``). If the environment variable ``GMT_LIBRARY_PATH`` is set, will | | 119 | + (``libgmt``). If the environment variable :term:`GMT_LIBRARY_PATH` is set, will | 120 | 120 | look for the shared library in the directory specified by it. | 121 | 121 |
| 122 | 122 | A ``GMTVersionError`` exception will be raised if the GMT shared library | |
Collapse file Copy file name to clipboardExpand all lines: pygmt/figure.py +3-3Lines changed: 3 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -43,7 +43,7 @@ def _get_default_display_method() -> Literal["external", "notebook", "none"]: | 43 | 43 | The default display method is ``"notebook"`` in the Jupyter notebook environment, | 44 | 44 | and ``"external"`` in other cases. | 45 | 45 |
| 46 | | - Setting environment variable **PYGMT_USE_EXTERNAL_DISPLAY** to ``"false"`` can | | 46 | + Setting environment variable :term:`PYGMT_USE_EXTERNAL_DISPLAY` to ``"false"`` can | 47 | 47 | disable image preview in external viewers. It's useful when running the tests and | 48 | 48 | building the documentation to avoid popping up windows. | 49 | 49 |
| @@ -421,8 +421,8 @@ def show( | 421 | 421 | resolution and dimension of the figure in the notebook. | 422 | 422 |
| 423 | 423 | The external viewer can be disabled by setting the environment variable | 424 | | - **PYGMT_USE_EXTERNAL_DISPLAY** to ``"false"``. This is useful when running tests | 425 | | - and building the documentation to avoid popping up windows. | | 424 | + :term:`PYGMT_USE_EXTERNAL_DISPLAY` to ``"false"``. This is useful when running | | 425 | + tests and building the documentation to avoid popping up windows. | 426 | 426 |
| 427 | 427 | The external viewer does not block the current process, thus it's necessary to | 428 | 428 | suspend the execution of the current process for a short while after launching | |
Collapse file Copy file name to clipboardExpand all lines: pygmt/src/timestamp.py +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -27,7 +27,7 @@ def timestamp( | 27 | 27 |
| 28 | 28 | Add the GMT timestamp logo with an optional label at the bottom-left corner of a | 29 | 29 | plot with an offset of ``("-54p", "-54p")``. The timestamp will be in the locale set | 30 | | - by the environment variable **TZ** (generally local time but can be changed via | | 30 | + by the environment variable :term:`TZ` (generally local time but can be changed via | 31 | 31 | ``os.environ["TZ"]``) and its format is controlled by the ``timefmt`` parameter. It | 32 | 32 | can also be replaced with any custom text string using the ``text`` parameter. | 33 | 33 |
| |
Collapse file Copy file name to clipboardExpand all lines: pygmt/src/x2sys_cross.py +7-7Lines changed: 7 additions & 7 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -96,13 +96,13 @@ def x2sys_cross( | 96 | 96 | or file names. Supported file formats are ASCII, native binary, or | 97 | 97 | COARDS netCDF 1-D data. More columns may also be present. | 98 | 98 |
| 99 | | - If the file names are missing their file extension, we will append the | 100 | | - suffix specified for this TAG. Track files will be searched for first | 101 | | - in the current directory and second in all directories listed in | 102 | | - $X2SYS_HOME/TAG/TAG_paths.txt (if it exists). [If $X2SYS_HOME is not | 103 | | - set it will default to $GMT_SHAREDIR/x2sys]. (**Note**: MGD77 files | 104 | | - will also be looked for via $MGD77_HOME/mgd77_paths.txt and .gmt | 105 | | - files will be searched for via $GMT_SHAREDIR/mgg/gmtfile_paths). | | 99 | + If the file names are missing their file extension, we will append the suffix | | 100 | + specified for this TAG. Track files will be searched for first in the current | | 101 | + directory and second in all directories listed in $X2SYS_HOME/TAG/TAG_paths.txt | | 102 | + (if it exists). [If environment variable :term:`X2SYS_HOME` is not set it will | | 103 | + default to $GMT_SHAREDIR/x2sys]. (**Note**: MGD77 files will also be looked for | | 104 | + via $MGD77_HOME/mgd77_paths.txt and .gmt files will be searched for via | | 105 | + $GMT_SHAREDIR/mgg/gmtfile_paths). | 106 | 106 |
| 107 | 107 | outfile | 108 | 108 | The file name for the output ASCII txt file to store the table in. | |
Collapse file Copy file name to clipboardExpand all lines: pygmt/src/x2sys_init.py +3-3Lines changed: 3 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -30,9 +30,9 @@ def x2sys_init(tag, **kwargs): | 30 | 30 | x2sys TAG. The TAG keeps track of settings such as file format, whether the | 31 | 31 | data are geographic or not, and the binning resolution for track indices. | 32 | 32 |
| 33 | | - Before you can run :func:`pygmt.x2sys_init` you must set the environmental | 34 | | - parameter X2SYS_HOME to a directory where you have write permission, which | 35 | | - is where x2sys can keep track of your settings. | | 33 | + Before you can run :func:`pygmt.x2sys_init` you must set the environment variable | | 34 | + :term:`X2SYS_HOME` to a directory where you have write permission, which is where | | 35 | + x2sys can keep track of your settings. | 36 | 36 |
| 37 | 37 | Full option list at :gmt-docs:`supplements/x2sys/x2sys_init.html` | 38 | 38 |
| |
|