Skip to main content

A suite of tools for Precision Agriculture

Project description

pyprecag

A suite of tools for Precision Agriculture data analysis

Precision Agriculture Tools (PAT) Plugin for QGIS contains tools for processing and analysing precision agriculture data which uses the pyPrecAg python module. For more infomation visit https://github.com/CSIRO-Precision-Agriculture/PAT_QGIS_Plugin

Citation

If you use pyprecag for any published work, please cite using the reference below:

Ratcliff, Christina; Gobbett, David; & Bramley, Rob (2025): pyprecag - a Python package for the analysis of precision agriculture data. CSIRO. v5. Software. http://hdl.handle.net/102.100.100/78353

Dependencies

Installation

pyprecag is available through the Python Packaging Index and can be installed with pip, however some dependencies require additional steps to install properly.

It is recommended to install pyprecag in a virtual environment so that the dependencies do not cause issues with your system-level Python installation.

VESPER Kriging is only supported on Windows platforms with the VESPER software installed.

Install via pip:

pip install pyprecag

Linux

The only dependency that causes issues is GDAL . The Python package is available from PyPI . However, the [libgdal-dev]{.title-ref} dependencies are required, and the location of the header files needs to be specified when installing. These libraries are available via UbuntuGIS and other avenues.

On Debian systems, this process should work. Add the unstable release of UbuntuGIS, get and install packages with:

sudo apt-get install software-properties-common
sudo apt-add-repository ppa:ubuntugis/ubuntugis-unstable
sudo apt-get update
sudo apt-get install libgdal-dev gdal-bin

If the above doesn't work try removing all gdal related files from the [/etc/apt/sources.list.d]{.title-ref} direcory and trying again (it's possible old files are interfering with install attempts).

Once the [libgdal-dev]{.title-ref} libraries and [gdal-bin]{.title-ref} are installed, pip install GDAL while specifying the version and the location of the header files with:

pip install GDAL==$(gdal-config --version) --global-option=build_ext --global-option="-I/usr/include/gdal"

Then pyprecag should install without issue.

Docker

The Dockerfile included in the examples directory builds a container with Pyprecag installed in an Ubuntu 18.04 image. Build the container with:

docker build -f docs/Dockerfile -t <tag> .

The tests can be run inside this container like this:

docker run <container id or tag> make test

Windows

The dependencies GDAL, Fiona , and Rasterio , all cause issues when installing on Windows.

The easiest way to install all of these is with the Windows Binaries provided by Christoph Gohlke at https://www.lfd.uci.edu/~gohlke/pythonlibs/. Download the Python 2.7 version for your system architecture then install them with:

pip install /path/to/<downloaded_file.whl>

It is recommended to install GDAL first, as it is a requirements for both Fiona and Rasterio. GDAL might also return an error and require you to install Visual C++.

They are also available from the conda-forge channel in conda. pyprecag is not currently available to install with conda, however can be pip installed in a conda environment and use the conda-installed versions of GDAL, Fiona and Rasterio.

Once those three dependencies are installed, pyprecag should install without issue.

Development

There is a makefile in the project root with targets for the most common development operations such as lint checks, running unit tests, building the documentation, and building installer packages. [tox]{.title-ref} does not have a target, as [make tox]{.title-ref} is more typing than [tox]{.title-ref}.

Run make with no target to see the list of targets:

$ make

Bump-my-version is used to manage the package version numbers. This ensures that the version number is correctly incremented in all required files. Please see the bumpversion documentation for usage instructions, and do not edit the version strings directly.

Version numbers follow the Semantic versioning guidelines.

Contributing

Contributions are welcome, and they are greatly appreciated! Every little bit helps, and credit will always be given.

Bug reports

When reporting a bug please include:

  • Your operating system name and version.
  • Any details about your local setup that might be helpful in troubleshooting.
  • The pyprecag package version.
  • Detailed steps to reproduce the bug.

Documentation improvements

pyprecag could always use more documentation, whether as part of the official pyprecag docs, in docstrings, or even on the web in blog posts, articles, and such.

:::: note ::: title Note :::

This project uses Google-style docstrings. Contributed code should follow the same conventions. For examples, please see the Napoleon examples, or the Google Python Style Guide. ::::

Feature requests and feedback

The best way to send feedback is to file an issue

If you are proposing a feature:

  • Explain in detail how it would work.
  • Keep the scope as narrow as possible, to make it easier to implement.
  • Remember that this is a volunteer-driven project, and that contributions are welcome :)

Or, implement the feature yourself and submit a pull request.

Development

To set up pyprecag for local development:

  1. Fork the [pyprecag]{.title-ref} repo on GitHub.
  2. Clone your fork locally:
$ git clone git@github.com:your_name_here/pyprecag.git
  1. Create a branch for local development:
git checkout -b name-of-your-bugfix-or-feature
Now you can make your changes locally.
  1. When you're done making changes, run all the tests, doc builder and pylint checks using the project makefile:
make clean lint test docs
  1. Commit your changes and push your branch to GitHub:
git add .
git commit -m "Your detailed description of your changes."
git push origin name-of-your-bugfix-or-feature
  1. Submit a pull request through the GitHub website.

Pull Request Guidelines

If you need some code review or feedback while you're developing the code just make the pull request.

For merging, you should:

  1. Include passing tests.
  2. Update documentation when there's new API, functionality etc.
  3. Add a note to CHANGELOG.rst about the changes.
  4. Add yourself to AUTHORS.rst.

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

pyprecag-0.4.3.tar.gz (285.3 kB view details)

Uploaded Source

Built Distribution

pyprecag-0.4.3-py3-none-any.whl (287.4 kB view details)

Uploaded Python 3

File details

Details for the file pyprecag-0.4.3.tar.gz.

File metadata

  • Download URL: pyprecag-0.4.3.tar.gz
  • Upload date:
  • Size: 285.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for pyprecag-0.4.3.tar.gz
Algorithm Hash digest
SHA256 b83963ae666caa9ff401c43914b934a9ecf6e82b101e6c4aaffa0646bc9da37e
MD5 a5a9c481e89e8bfe0159e5334db03dff
BLAKE2b-256 bb3ef45276505f1dbae714ee9eaf46211656be2be034336eb3ca0d8be93c56a8

See more details on using hashes here.

File details

Details for the file pyprecag-0.4.3-py3-none-any.whl.

File metadata

  • Download URL: pyprecag-0.4.3-py3-none-any.whl
  • Upload date:
  • Size: 287.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for pyprecag-0.4.3-py3-none-any.whl
Algorithm Hash digest
SHA256 4c869e12b09cd592d7d8d5ff29f5c2a9ccb8d87d05ea8af00cc30c9a53fd99cd
MD5 11357140b56583ebd9a444cc3a0ffba2
BLAKE2b-256 066d6727a1643640ab8d8733885aa6ecc6f52638e159aef83e2bfd42e0e0d10d

See more details on using hashes here.

Supported by

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