gaussquad

Gauss quadrature for arbitrary weight functions on finite intervals

https://github.com/thatmariia/gaussquad

Science Score: 57.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 4 DOI reference(s) in README
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (16.2%) to scientific vocabulary
Last synced: 10 months ago · JSON representation ·

Repository

Gauss quadrature for arbitrary weight functions on finite intervals

Basic Info
Statistics
  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 1
Created about 1 year ago · Last pushed about 1 year ago
Metadata Files
Readme License Citation

README.md

gaussquad

A mini-package to compute Gauss quadrature nodes and weights for arbitrary weight functions on finite intervals using the Golub–Welsch algorithm.

Based on:
- Golub & Welsch (1969)
- Technical report (1967)

Documentation is available at thatmariia.github.io/gaussquad

GitHub Pages


Features

  • Compute quadrature nodes and weights for custom weight functions
  • Use them directly to approximate integrals

Installation

From PyPI:

bash pip install gaussquad

From GitHub:

bash pip install git+https://github.com/thatmariia/gaussquad.git

Requirements: Python 3.13 or newer, numpy, scipy

Usage

You can integrate x^2 * w(x) from 0 to 5 with a weight function w(x)=exp(-x):

```python import numpy as np from gaussquad import wquad

result = wquad( fn=lambda x: x**2, weightfn=lambda x: np.exp(-x), interval=(0, 5), degree=5, momentmethod="legendre" # approximation for moments )

print(f"Integral of x^2 from 0 to 5 with weight function exp(-x): {result}") # ≈ 1.7507 ```

More examples: docs » usage.md.

Development & docs

```bash git clone https://github.com/thatmariia/gaussquad.git cd gaussquad python -m venv venv source venv/bin/activate # or venv\Scripts\activate on Windows

pip install -e ".[dev,docs]" ```

| Command | Description | | ------- | ----------- | | pytest | Run tests | | flake8 src/ | Check code style | | black --check src/ | Check code style | | cd docs && make html | Build docs | | open docs/build/html/index.html | View docs (macOS) | | python -m http.server --directory docs/build/html | View docs (all OS) |


Citation

If you use this package in your research, please cite it using the information under "Cite this repository" on the right side of the GitHub page.

If you need a version-specific citation, you can find it on Zenodo.


License

This project is licensed under the Apache-2.0 License. See the LICENSE file for details.

Owner

  • Name: Mariia Steeghs-Turchina
  • Login: thatmariia
  • Kind: user

Citation (CITATION.cff)

cff-version: 1.2.0
message: "If you use this software, please cite it. DOIs for specific versions are on Zenodo: https://doi.org/10.5281/zenodo.15468025."
title: "gaussquad: Gauss quadrature for arbitrary weights on finite intervals"
doi: 10.5281/zenodo.15468025
authors:
  - family-names: Steeghs-Turchina
    given-names: Mariia
    orcid: https://orcid.org/0000-0002-0852-4752
license: Apache-2.0
repository: https://github.com/thatmariia/gaussquad
keywords:
  - gauss quadrature
  - numerical integration
  - golub-welsch
  - python

GitHub Events

Total
  • Release event: 4
  • Delete event: 11
  • Push event: 60
  • Create event: 16
Last Year
  • Release event: 4
  • Delete event: 11
  • Push event: 60
  • Create event: 16

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 16 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 2
  • Total maintainers: 1
pypi.org: gaussquad

Compute Gauss quadrature nodes and weights for arbitrary weight functions.

  • Versions: 2
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 16 Last month
Rankings
Dependent packages count: 9.1%
Average: 30.2%
Dependent repos count: 51.4%
Maintainers (1)
Last synced: 10 months ago

Dependencies

.github/workflows/ci.yml actions
  • actions/checkout v4 composite
  • actions/setup-python v5 composite
  • peaceiris/actions-gh-pages v3 composite
pyproject.toml pypi
  • numpy >=2.2.0
  • scipy >=1.15.0