Skip to main content

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

DOI Build Status Build status codecov Docs build Code style: black

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

earthpy-0.6.6.tar.gz (1.4 MB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page