Skip to main content

Simple Implementation of Fourth-Order WENO Interpolation

Chris Osborne, University of Glasgow, 2020, MIT License

Direct implementation from the very clear method presented in Janett et al (2019). Weighted Essentially Non-Oscillatory (WENO) techniques are used to provide high order reconstructions of data, whilst remaining stable around discontinuities. Most WENO algorithms are designed for reconstructing interface values in finite difference and finite volume codes (often assuming uniform grids). The method implemented here was designed for arbitrary interpolation on non-uniform grids.

The file weno4.py, provides one function weno4, that performs the interpolation, with optional quadratic extrapolation on the extremities (off by default). See the docstring for more information.

Running the file weno4.py directly should reproduce the test cases from the paper, and should look something like this:

Comparison of WENO4 against other interpolators on test cases

Note that this WENO scheme does not enforce monotonicity, and may introduce small under- or overshoots around extrema (although without "ringing"), which can possibly introduce negative values in the the interpolation of a strictly positive function (e.g. the modified Heaviside test case).

Prerequisites

  • python >=3.6
  • numpy (tested on 1.18.2)
  • numba (tested on 0.48 & 0.49)

If you want to run the examples:

  • scipy
  • matplotlib

Installation

pip install weno4

Reference

Janett et al (2019). A&A 624, A104

Metadata

Release files for weno4 1.1.1

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

Source distribution (sdist)

Source distribution for weno4 1.1.1
File Size Uploaded Provenance Actions
weno4-1.1.1.tar.gz 5.5 kB Without provenance Details for weno4-1.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for weno4 1.1.1
File Interpreter ABI Platform Actions
weno4-1.1.1-py3-none-any.whl Python 3 none any Details for weno4-1.1.1-py3-none-any.whl

Total release size: 11.7 kB

Release files / weno4-1.1.1.tar.gz

Download URL weno4-1.1.1.tar.gz
Size 5.5 kB
Tags Source
SHA-256 checksum
How to use checksums
4adffa4057e90249a5a73dfcaaaeed3cd9c5a7d9e17f08ea1db9f81a703198bc
BLAKE2b-256 checksum
How to use checksums
207b56e5031dc76ec89a4d11aafd43fec74fd96d93b93f063d4ea7e4fe659821
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.8.2

Release files / weno4-1.1.1-py3-none-any.whl

Download URL weno4-1.1.1-py3-none-any.whl
Size 6.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
32a3cfebc08e2d53ac5b44b283711325316372e608d657225b487f4b01e715a6
BLAKE2b-256 checksum
How to use checksums
b2009f9cc0019b896ed287b30a3364bfffcca9a783a6854b83d707397a4746df
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.8.2

Security for weno4 1.1.1

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