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 the PyGMT ecosystem page #3475

Open
wants to merge 30 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
149e0b3
Initial layout for the ecosystem page
seisman Oct 1, 2024
80005c4
Remove xyzservices
seisman Oct 2, 2024
69753a0
Add more packages
seisman Oct 2, 2024
e44e263
Add description about the contextily package
seisman Oct 4, 2024
1cc1f18
Credit to geopandas ecosystem
seisman Oct 4, 2024
5807616
Fix a typo
seisman Oct 4, 2024
1168864
Remove rasterio since PyGMT doesn't rely on it directly
seisman Oct 4, 2024
42712ff
Add description about geopandas
seisman Oct 4, 2024
7fdc368
Fix
seisman Oct 5, 2024
07582ca
Add more description
seisman Oct 5, 2024
0729a64
Add numpy link
seisman Oct 5, 2024
370cc43
Update ecosystem
seisman Oct 7, 2024
f770d9f
Fix typos
seisman Oct 7, 2024
8349682
Fix
seisman Oct 7, 2024
7f63557
Apply suggestions from code review
seisman Oct 9, 2024
1366364
Add a note at the page bottom
seisman Oct 9, 2024
51e2c5f
Fix the link to contributing guides
seisman Oct 9, 2024
8423376
Fix xarray to Xarray
seisman Oct 10, 2024
54b7ff4
Fix GeoPandas
seisman Oct 10, 2024
76b7f97
Fix package name cases
seisman Oct 10, 2024
d7b5f05
Update the pyarrow note to match changes in PR #2933
seisman Oct 11, 2024
e4a6834
Minor fixes
seisman Oct 11, 2024
297c02b
Remove unnecessary descriptions [skip ci]
seisman Oct 14, 2024
086fb10
Remove headings of 'Required dependencies' and 'Optional dependencies'
seisman Oct 14, 2024
770968e
Revert the changes in PR #2933
seisman Oct 15, 2024
912dfd9
Merge branch 'main' into doc/ecosystem
seisman Oct 16, 2024
197dbc3
Merge branch 'main' into doc/ecosystem
seisman Oct 16, 2024
badfe16
Minor changes
seisman Oct 16, 2024
5bf8c5d
Move ecosystem to the Reference Documentation section
seisman Oct 16, 2024
63901fc
Merge branch 'main' into doc/ecosystem
seisman Oct 19, 2024
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
127 changes: 127 additions & 0 deletions doc/ecosystem.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
# Ecosystem

PyGMT provides a Python interface to the Generic Mapping Tools (GMT), which is a command
line program that provides a wide range of tools for manipulating geospatial data and
making publication-quality maps and figures. PyGMT integrates well with the
[scientific Python ecosystem](https://scientific-python.org/), with [NumPy][] for its
fundamental array data structure, [pandas][] for tabular data I/O and [Xarray][] for
raster grids/images/cubes I/O.

In addition to these core dependencies, PyGMT also relies on several optional packages to
provide additional functionality for users.

*This page was adapted from [GeoPandas's Ecosystem](https://geopandas.org/en/latest/community/ecosystem.html) page.*

## PyGMT dependencies

Asterisk (*) indicates that the package is a required dependency of PyGMT.

### NumPy*

[NumPy][] is the fundamental package for scientific computing in Python. It is a Python
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

library that provides a multidimensional array object, various derived objects (such as
masked arrays and matrices), and an assortment of routines for fast operations on arrays,
including mathematical, logical, shape manipulation, sorting, selecting, I/O, discrete
Fourier transforms, basic linear algebra, basic statistical operations, random simulation
and much more.

### pandas*

[pandas][] is a Python package providing fast, flexible, and expressive data structures
yvonnefroehlich marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

designed to make working with "relational" or "labeled" data both easy and intuitive.
It aims to be the fundamental high-level building block for doing practical, real-world
data analysis in Python.

### Xarray*

[Xarray][] is an open source project and Python package that introduces labels in the
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This paragraph comes from https://xarray.dev/.

form of dimensions, coordinates, and attributes on top of raw NumPy-like arrays, which
allows for more intuitive, more concise, and less error-prone user experience.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Required packages "packaging" and "netCDF4" are not documented yet. Do we want to document these two packages?


### IPython

[IPython][] provides a rich toolkit to help you make the most of using Python
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

interactively. Its main components are a powerful interactive Python shell and a Jupyter
kernel to work with Python code in Jupyter notebooks and other interactive frontends.

PyGMT relies on IPython to provide a rich interactive experience in Jupyter notebooks.

### GeoPandas

[GeoPandas][] is an open source project to make working with geospatial data in Python
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

easier. GeoPandas extends the datatypes used by [pandas][] to allow spatial operations
on geometric types. Geometric operations are performed by [Shapely][]. GeoPandas further
depends on [pyogrio][] for file access and [Matplotlib][] for plotting.

PyGMT doesn't directly rely on GeoPandas, but provides support of GeoPandas's two main
data structure, {class}`geopandas.GeoDataFrame` and {class}`geopandas.GeoSeries`, which
can be directly used in data processing and plotting functions/methods of PyGMT.

### contextily

[contextily][] is a small Python package to retrieve tile maps from the internet. It can
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add those tiles as basemap to matplotlib figures or write tile maps to disk into
geospatial raster files.

In PyGMT, {func}`pygmt.datasets.load_tile_map` and {class}`pygmt.Figure.tilemap` rely
on it.

### rioxarray

[rioxarray][] is a geospatial [Xarray][] extension powered by [rasterio][]. Built on top
of rasterio, it enables seamless reading, writing, and manipulation of multi-dimensional
arrays with geospatial attributes such as coordinate reference systems (CRS) and spatial
extent (bounds).

Currently, PyGMT relies on [rioxarray][] to save multi-band rasters to temporary files
in GeoTIFF format, to support processing and plotting 3-D {class}`xarray.DataArray`
images.

```{note}
We're working towards removing the dependency of the [rioxarray][] package in
[PR #3468](https://github.com/GenericMappingTools/pygmt/pull/3468).
```

### PyArrow

[Apache Arrow][] is a development platform for in-memory analytics. It contains a set of
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

technologies that enable big data systems to process and move data fast. It specifies a
standardized language-independent columnar memory format for flat and hierarchical data,
organized for efficient analytic operations on modern hardware. The Arrow Python bindings
(also named "PyArrow") have first-class integration with NumPy, pandas, and built-in
Python objects. They are based on the C++ implementation of Arrow.

```{note}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This note is copied from https://www.pygmt.org/dev/install.html with updates from PR #2933.

The plan is to remove the note from https://www.pygmt.org/dev/install.html. See PR #3506.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's likely this PR will be merged before PR #2933, so I've reverted the changes in PR #2933 (770968e) and use the original notes from the installation guides.

If you have [PyArrow][] installed, PyGMT does have some initial support for
`pandas.Series` and `pandas.DataFrame` objects with Apache Arrow-backed arrays.
Specifically, only uint/int/float, date32/date64 and string types are supported for now.
Support for Duration types and GeoArrow geometry types is still a work in progress.
seisman marked this conversation as resolved.
Show resolved Hide resolved
For more details, see
[issue #2800](https://github.com/GenericMappingTools/pygmt/issues/2800).
```

## PyGMT ecosystem

Various packages rely on PyGMT for geospatial data processing, analysis, and visualization.
Below is an incomplete list (in no particular order) of tools which form the PyGMT-related
ecosystem.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For a package that rely on PyGMT, I think a short description about the package itself and how PyGMT is used in the package is enough.

For example, I know SHTOOLS maintained by MarkWieczorek uses PyGMT. I expect to see it listed here like below:

### SHTOOLS

pyshtools is an archive of Python software that can be used for spherical harmonic transforms, multitaper spectral analyses, expansions of gridded data into Slepian basis functions, and standard operations on global gravitational and magnetic field data.

It uses PyGMT for the creation of publication quality maps.

I don't plan to add SHTOOLS myself. Instead, after merging this PR, I prefer to ping MarkWieczorek to see if he is willing to add SHTOOLS himself.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good to me.


```{note}
If your package relies on PyGMT, please
[let us know](https://github.com/GenericMappingTools/pygmt/issues/new) or
[add it by yourself](contributing.md).
```

[apache arrow]: https://arrow.apache.org/
[contextily]: https://contextily.readthedocs.io/
[geopandas]: https://geopandas.org/
[ipython]: https://ipython.org/
[matplotlib]: https://matplotlib.org/
[numpy]: https://numpy.org/
[pandas]: https://pandas.pydata.org/
[pyarrow]: https://arrow.apache.org/docs/python/
[pyogrio]: https://pyogrio.readthedocs.io/
[rasterio]: https://rasterio.readthedocs.io/
[rioxarray]: https://corteva.github.io/rioxarray/
[shapely]: https://shapely.readthedocs.io/
[xarray]: https://xarray.pydata.org/
1 change: 1 addition & 0 deletions doc/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,5 @@ minversions.md
team.md
contributing.md
maintenance.md
ecosystem.md
seisman marked this conversation as resolved.
Show resolved Hide resolved
```