A set of helper functions to make working with spatial data in open source tools easier. This package is maintained by Earth Lab and was originally designed to support the earth analytics education program.
Project description
EarthPy
A package that supports working with spatial data in python teaching.
Install
To install, use pip. --upgrade
is optional but it ensures that the package overwrites
when you install and you have the current version. If you don't have the package
yet you can still use the --upgrade
argument.
$ pip install --upgrade git+https://github.com/earthlab/earthpy.git
Then import it into python.
>>> import earthpy as et
Active Contributors
- Leah Wasser
- Max Joseph
- Joe McGlinchy
- Tim Head
- Chris Holdgraf
- Jenny Palomino
Testing
This package uses pytest for tests.
To run tests locally, execute the command pytest
from the command line:
$ pytest --doctest-modules
The --doctest-modules
syntax allows pytest to check examples in
docstrings contained in modules (e.g., if a function has an example section),
in addition to the normal tests that pytest would discover.
Testing example code in the docs
directory
To locally test examples in the docs
directory (e.g., examples contained in
.rst
files), you can run the following command from the top-level
earthpy
directory:
$ make -C docs doctest
Data generated for testing
If a test requires a data object such as a GeoDataFrame or numpy array, and copies of that data object are required by multiple tests, we can use pytest fixtures to cleanly create and tear down those objects independently for each test.
See earthpy/tests/conftest.py
for fixture
definitions, and earthpy/tests/test_clip.py
for example usage of fixtures in tests.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.