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.2

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.2
File Size Uploaded Provenance Actions
smoother_py-0.1.2.tar.gz 359.0 kB Without provenance Details for smoother_py-0.1.2.tar.gz

Built distributions (wheels)

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

Total release size: 479.3 kB

Release files / smoother_py-0.1.2.tar.gz

Download URL smoother_py-0.1.2.tar.gz
Size 359.0 kB
Tags Source
SHA-256 checksum
How to use checksums
90d3b3dd570b5124e6edefd7ca2e3b0149303cf28616840921e354ca25f2c884
BLAKE2b-256 checksum
How to use checksums
72f485a7f2f968d4d04cebadf39cea64939cf31eeccd53ee87094ec61d9e8a98
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.2-cp314-cp314-pyemscripten_2026_0_wasm32.whl

Download URL smoother_py-0.1.2-cp314-cp314-pyemscripten_2026_0_wasm32.whl
Size 50.1 kB
Tags CPython 3.14 PyEmscripten 2026.0+ WebAssembly
SHA-256 checksum
How to use checksums
9b52f3491d5cea7b0824808aa103c9b6fba987086b8446d4f9b15de98f76b711
BLAKE2b-256 checksum
How to use checksums
d5fb1b806768521b7731600c144267d560ca950dd78765ee7798f26263987fa5
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.2-cp312-abi3-macosx_26_0_arm64.whl

Download URL smoother_py-0.1.2-cp312-abi3-macosx_26_0_arm64.whl
Size 70.1 kB
Tags CPython 3.12 abi3 macOS 26.0+ ARM64
SHA-256 checksum
How to use checksums
f88967b225d42ad2437f7789472b64265b7f1fa29ef1a1b12d6ad22a3d7c41f8
BLAKE2b-256 checksum
How to use checksums
f227aa237c46ddd1ebcb7e418629325d8979cdb3a6d63acc55bb3b180bc60a25
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.2

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