Skip to content

Exploration utilities for Wildlife Insights projects.

License

Notifications You must be signed in to change notification settings

PEM-Humboldt/wiutils

Repository files navigation

wiutils

wiutils has several utilities for exploring and manipulating (filtering, plotting and summarizing) information from Wildlife Insights projects. These functions are useful to compute basic statistics, prepare the information for further analysis (e.g. occupancy models) and translate it into other standards (i.e. Darwin Core) that facilitate its publication on biodiversity information centers (e.g. GBIF).

Installation

Currently, wiutils works with Python versions 3.6 through 3.10.

Using pip:

pip install wiutils

Using conda:

conda install -c conda-forge wiutils

Execution

To check whether the installation of wiutils was successful, execute the following command:

python -c "import wiutils"

If this does not throw any error, the installation was successful.

You can use wiutils functions by importing the package from a Python console or script. For more information about the available functions, check the documentation.

How to contribute

Everybody is welcome to contribute to wiutils. People can contribute to the development of the package but also to the improvement of the documentation and by reporting potential bugs.

Setup

It is recommended to install the package using a virtual environment to avoid tampering other Python installations in your system.

Clone this repo in your computer:

git clone https://github.com/PEM-Humboldt/wiutils.git

Go to the project's root:

cd wiutils

Install the package in development mode:

pip install --editable .[dev,docs,test]

Make sure that any new development is done in a new branch. After you are finished, submit a pull request to incorporate the changes.

Unit tests

Execute the following command inside the project's root:

pytest tests/

Python versions

wiutils works with Python versions 3.6 through 3.10. To make sure that the code works for all these versions, tox is used. Make sure you have installed these Python versions on your system and then run the following command inside the project's root:

tox

This will run all the unit tests for every Python version to make sure everything works correctly.

If you add any new depedency to the project, make sure to run tox as follows so it can recreate the environments:

tox -r

Code coverage

We make sure the code coverage is 100%. Ideally, when implementing new features or making changes, you should make sure that the code coverage is still 100%. For this, run the coverage for the tests:

coverage run -m pytest tests/

And then run the report:

coverage report -m -i

Code style

We use pre-commit hooks to make sure new changes adhere to different coding guidelines. You need to install these hooks just once (ideally before doing any commit) by running:

pre-commit install

After that, every commit you try to make will run the hooks before committing the changes. If the hooks modified your changes, you'll have to add those files and commit again.

Authors and contributors

  • Adriana Restrepo-Isaza
  • Angélica Diaz-Pulido
  • Marcelo Villa-Piñeros - marcelovilla

License

This project is licensed under the MIT License - see the LICENSE.txt file for details.