obsarray is an extension to xarray for defining, storing and interfacing with uncertainty information using standardised metadata. It is particularly designed to work well with netCDF files and for the Earth Observation community.
Upcoming change: obsarray currently follows v0.1 of the UNC specification for uncertainty metadata. A future release will default to draft v0.2, which is proposed for inclusion in the CF conventions and is not backwards compatible with v0.1. See what this means for you.
obsarray is part of the CoMet Toolkit (community metrology toolkit), and can combined with the punpy (propagating uncertainties in python) module for very simple propagation of defined data uncertainties through arbitrary python functions.
obsarray is installable via pip:
pip install obsarrayFor more information visit our documentation.
Clone the repository and install it in editable mode with the development extras:
pip install -e ".[dev]" # Development tools (ruff, mypy, pytest, …)
pip install -e ".[docs]" # Documentation build (sphinx, …)Install the pre-commit hooks after cloning:
pre-commit installWhen you commit, ruff will lint and format your code and mypy will
type-check it. If it makes corrections the commit will be aborted so you can
review the changes — just commit again once you are happy.
Run the test suite with:
pytestThe package version is derived from git tags by
setuptools_scm, so there is no
version number to edit in the source. To release, tag main and push the tag:
git tag v<X.Y.Z>
git push origin v<X.Y.Z>This triggers the publish.yml GitHub Actions workflow, which runs the tests,
builds the sdist and wheel, and publishes them to PyPI via trusted publishing.
The workflow can also be run manually from the GitHub Actions UI (type
publish in the confirmation input).
obsarray requires Python 3.11 or later and is tested on Python 3.11, 3.12, and 3.13.
obsarray is free software licensed under the GNU Lesser General Public License (v3).
obsarray has been developed by the CoMet Toolkit Team.
The development has been funded by:
- The UK's Department for Business, Energy and Industrial Strategy's (BEIS) National Measurement System (NMS) programme
- The IDEAS-QA4EO project funded by the European Space Agency.
obsarray is under active development. It is beta software.