Skip to main content

smoother.py 🧹

Spatial smoothing methods for probability maps.

Installation

To install the package, you can use pip:

pip install smoother-py

Methods available

Currently, the smoother implements the Bayes smoothing method, adapting the code from the sits R package.

Usage

First, import the package:

import smoother

Then, use the smooth function on the numpy data of your map. The smoothing method is selected with method (defaults to "bayes"), and any method-specific options are passed as keyword arguments:

smoothed = smoother.smooth(your_numpy_array)

# selecting the method explicitly and tuning it
smoothed = smoother.smooth(your_numpy_array, method="bayes", window_size=5)

You can use rasterio or other library to load the numpy array.

xarray

smooth also accepts xarray objects. To use it, first install the xarray dependencies:

pip install "smoother-py[xarray]"

Then, using your xarray data, you can call the smooth function:

# DataArray with class, y and x dimensions
smoothed = smoother.smooth(your_data_array)

# dimension names are inferred (e.g. band/class, y/latitude, x/longitude)
# you can also name them explicitly
smoothed = smoother.smooth(your_data_array, class_dim="band")

Extra dimensions (e.g. time) are smoothed per layer automatically.

Discovering the options

smoother.smooth documents every option, the smoothing parameters and the xarray-only dimension names:

help(smoother.smooth)

Development

The project uses uv to manage the development environment:

# create the environment and build/install the package
uv sync

# run the tests
uv run pytest

Learn more

The smoothing methods implemented in this package uses the approach described in the sits documentation. This method helps in refining the probability maps by considering the spatial context of each pixel.

Acknowledgments

We would like to thank the developers and contributors of the sits R package for their work on spatial smoothing methods for Earth observation data. Their comprehensive documentation and methodologies have been invaluable in the development of smoother.py.

Contributing

We welcome contributions! If you have suggestions for improvements or bug fixes, please feel free to fork the repository and submit a pull request.

License

Code is licensed under the GNU General Public License v2.0. See the LICENSE file. The bayes smooth code is ported from the sits R package.

Metadata

Release files for smoother-py 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for smoother-py 0.1.3
File Size Uploaded Provenance Actions
smoother_py-0.1.3.tar.gz 362.2 kB Without provenance Details for smoother_py-0.1.3.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for smoother-py 0.1.3
File Interpreter ABI Platform Actions
smoother_py-0.1.3-cp314-cp314-pyemscripten_2026_0_wasm32.whl CPython 3.14 CPython 3.14 PyEmscripten 2026.0+ WebAssembly Details for smoother_py-0.1.3-cp314-cp314-pyemscripten_2026_0_wasm32.whl
smoother_py-0.1.3-cp312-abi3-macosx_26_0_arm64.whl CPython 3.12 abi3 macOS 26.0+ ARM64 Details for smoother_py-0.1.3-cp312-abi3-macosx_26_0_arm64.whl

Total release size: 487.6 kB

Release files / smoother_py-0.1.3.tar.gz

Download URL smoother_py-0.1.3.tar.gz
Size 362.2 kB
Tags Source
SHA-256 checksum
How to use checksums
8f5fc4cbc50f98c49165c0c7ff2dfa1589f1da54fbe4af24ea9dd1a9ded2e329
BLAKE2b-256 checksum
How to use checksums
48f046901544bdbf155b2808dcad7bfebd19e289521ee8d2e6e0cf3ee5caec36
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.9 {"installer":{"name":"uv","version":"0.12.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / smoother_py-0.1.3-cp314-cp314-pyemscripten_2026_0_wasm32.whl

Download URL smoother_py-0.1.3-cp314-cp314-pyemscripten_2026_0_wasm32.whl
Size 52.7 kB
Tags CPython 3.14 PyEmscripten 2026.0+ WebAssembly
SHA-256 checksum
How to use checksums
b1d3681a3a4de068c8a809b325bfd85cf0279aa518f138a683a78b4438785b32
BLAKE2b-256 checksum
How to use checksums
c2bc8f11aed1cbcb7ee8ed486340b4277623c0f4d7e5732017fc68674cc0a543
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.9 {"installer":{"name":"uv","version":"0.12.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / smoother_py-0.1.3-cp312-abi3-macosx_26_0_arm64.whl

Download URL smoother_py-0.1.3-cp312-abi3-macosx_26_0_arm64.whl
Size 72.7 kB
Tags CPython 3.12 abi3 macOS 26.0+ ARM64
SHA-256 checksum
How to use checksums
090045f7d4654fb04c8020760ea46671bf43950785c5fd7d4a557538df22619b
BLAKE2b-256 checksum
How to use checksums
5f196c8073f6ca9067b21ceb2227e81eead893dc537786e73f94419b76c785e6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.9 {"installer":{"name":"uv","version":"0.12.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for smoother-py 0.1.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page