Skip to main content

Numerical integration technique

Project description

Cubature

Cubature

Github Actions status:

pytest and coverage

Coverage status:

Codecov Status

What is Cubature?

It is a numerical integration technique. From MathWorld http://mathworld.wolfram.com/Cubature.html, Ueberhuber (1997, p. 71) and Krommer and Ueberhuber (1998, pp. 49 and 155-165) use the word "quadrature" to mean numerical computation of a univariate integral, and "cubature" to mean numerical computation of a multiple integral.

Cubature for Python

This is a wrapper to Prof. Steven Johnson's C package, available at https://github.com/stevengj/cubature. The current version is a wrapper to version 1.0.4 of Prof. Johnson's package.

Documentation

Please, see the module documentation here http://saullocastro.github.io/cubature.

Python wrapper for the Cubature package

From the Nanostructures and Computation Wiki at MIT http://ab-initio.mit.edu/wiki/index.php/Cubature, Steven W. Johnson http://math.mit.edu/~stevenj has written a simple C package for adaptive multidimensional integration (cubature) of vector-valued functions over hypercubes and this is a Python wrapper for the referred C package.

Installation from source code

You must have Cython installed. Then do:

python setup.py install 

or (usually in Linux):

python3 setup.py install

Installation from pip repository

Just do:

python -m pip install cubature

or (usually in Linux):

python3 -m pip install cubature

Running the tests

To run the tests you will have to download the source code. After installing as explained above, go to the source code root folder and run:

py.test .

The Python wrapper has been proven using test integrands from the C package and some additional testing functions from Genz. The integrands were implemented in Cython and verified with Mathematica.

Citing this Python wrapper for Cubature

We kindly ask you to cite this Python library properly. Also, it would be helpful if you could cite the papers where this methods has been applied as well.

Castro, S.G.P.; Loukianov, A.; et al. "Python wrapper for Cubature: adaptive multidimensional integration". DOI:10.5281/zenodo.2541552. Version 0.18.8, 2025.

Citing Papers using this Python wrapper for Cubature

Used to integrate tangent stiffness matrices in computational solid mechanics

Castro, S.G.P. et al. "Evaluation of non-linear buckling loads of geometrically imperfect composite cylinders and cones with the Ritz method". Composite Structures, Vol. 122, 284-299, 2015.

Castro, S.G.P. et al. "A semi-analytical approach for linear and non-linear analysis of unstiffened laminated composite cylinders and cones under axial, torsion and pressure loads". Thin-Walled Structures, Vol. 90, 61-73, 2015.

Examples

Some examples are given in "./examples" https://github.com/saullocastro/cubature/tree/master/examples.

Fork me!

You are welcome to fork this repository and modify it in whatever way you want. It will also be nice if you could send a pull request here in case you think your modifications are valuable for another person.

License

This wrapper follows the GNU-GPL license terms of Steven G. Johnson described in the C Package <https://github.com/saullocastro/cubature/tree/master/cubature/cpackage/COPYING>_.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cubature-0.18.8.tar.gz (15.3 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

cubature-0.18.8-cp313-cp313-win_amd64.whl (10.5 MB view details)

Uploaded CPython 3.13Windows x86-64

cubature-0.18.8-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (11.6 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

cubature-0.18.8-cp313-cp313-macosx_10_13_universal2.whl (21.2 MB view details)

Uploaded CPython 3.13macOS 10.13+ universal2 (ARM64, x86-64)

cubature-0.18.8-cp312-cp312-win_amd64.whl (10.5 MB view details)

Uploaded CPython 3.12Windows x86-64

cubature-0.18.8-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (11.6 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

cubature-0.18.8-cp312-cp312-macosx_10_13_universal2.whl (21.2 MB view details)

Uploaded CPython 3.12macOS 10.13+ universal2 (ARM64, x86-64)

cubature-0.18.8-cp311-cp311-win_amd64.whl (10.5 MB view details)

Uploaded CPython 3.11Windows x86-64

cubature-0.18.8-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (11.6 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

cubature-0.18.8-cp311-cp311-macosx_10_9_universal2.whl (21.2 MB view details)

Uploaded CPython 3.11macOS 10.9+ universal2 (ARM64, x86-64)

cubature-0.18.8-cp310-cp310-win_amd64.whl (10.5 MB view details)

Uploaded CPython 3.10Windows x86-64

cubature-0.18.8-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (11.5 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

cubature-0.18.8-cp310-cp310-macosx_10_9_universal2.whl (21.2 MB view details)

Uploaded CPython 3.10macOS 10.9+ universal2 (ARM64, x86-64)

cubature-0.18.8-cp39-cp39-win_amd64.whl (10.5 MB view details)

Uploaded CPython 3.9Windows x86-64

cubature-0.18.8-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (11.5 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

cubature-0.18.8-cp39-cp39-macosx_10_9_universal2.whl (21.2 MB view details)

Uploaded CPython 3.9macOS 10.9+ universal2 (ARM64, x86-64)

cubature-0.18.8-cp38-cp38-win_amd64.whl (10.5 MB view details)

Uploaded CPython 3.8Windows x86-64

cubature-0.18.8-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (11.6 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

cubature-0.18.8-cp38-cp38-macosx_11_0_universal2.whl (21.2 MB view details)

Uploaded CPython 3.8macOS 11.0+ universal2 (ARM64, x86-64)

File details

Details for the file cubature-0.18.8.tar.gz.

File metadata

  • Download URL: cubature-0.18.8.tar.gz
  • Upload date:
  • Size: 15.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for cubature-0.18.8.tar.gz
Algorithm Hash digest
SHA256 ae27dd47a9384cfe7d9951aab7983594b95d338bf7007d362fa00becd3ff67db
MD5 66f60f0c9e10234396f3d4396d73c750
BLAKE2b-256 630171ea0a417323f82cf465e332c9e93d7c9648d489d0693192701306a3c325

See more details on using hashes here.

File details

Details for the file cubature-0.18.8-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: cubature-0.18.8-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 10.5 MB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for cubature-0.18.8-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 8c61fa42225ad124348626b99a81286af58fd3a6f039ab0076a9cf64bcb61768
MD5 bc55f0b4a6884aa7a2961b74d002aa80
BLAKE2b-256 e7eb31151be3386dd7383803b1edd6bebad22a4453e75624301346e87d4f098e

See more details on using hashes here.

File details

Details for the file cubature-0.18.8-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cubature-0.18.8-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b1ec8ba5e7d0c68a83873ecb3af9c57a375c4a1df3191ce24944c97204654222
MD5 712d770428f785e82efe469d84b0983f
BLAKE2b-256 7a235f456ad12b94d22817383d57e20f3c0c6a297b76b3f293551c8d635349ce

See more details on using hashes here.

File details

Details for the file cubature-0.18.8-cp313-cp313-macosx_10_13_universal2.whl.

File metadata

File hashes

Hashes for cubature-0.18.8-cp313-cp313-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 d85da8af4616b3c11caecead608efbaac5b139ec047e541a8eb470d79b2a9ef5
MD5 3a80504aa5e7f0bd243d3610f51d7369
BLAKE2b-256 920b9e071dfbb7ba97aa22d3bc948ae801e0cbc620642f40cd2e2ece8127d1e6

See more details on using hashes here.

File details

Details for the file cubature-0.18.8-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: cubature-0.18.8-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 10.5 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for cubature-0.18.8-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 c0f1b81b96fa284bf58ace04d01f4143733b7f1ccc40f6b4bd54bbf33af09cbf
MD5 3bae0cd4658a2f3486421d22749c2f02
BLAKE2b-256 25a493d387b44ba5400fde96f3e8e48348ad9c8968f39b973aa08ec968715104

See more details on using hashes here.

File details

Details for the file cubature-0.18.8-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cubature-0.18.8-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 99e1b44bfd0f1decdce6279044b17529a28e762bd5f5c0916b6cf30e44cc9f6a
MD5 632f015a86811e745a8f298473169c8d
BLAKE2b-256 72175d4b4cd0ef08a7c6dc36128f3b8159aa348175ef1274aaf4a6436dcb7fb8

See more details on using hashes here.

File details

Details for the file cubature-0.18.8-cp312-cp312-macosx_10_13_universal2.whl.

File metadata

File hashes

Hashes for cubature-0.18.8-cp312-cp312-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 2c1e6fbed884e224a676d20ef03a38ae94a689d564b2e0f7df22ebf7984e1634
MD5 30baefb229d6f4469d84b6a51a29577b
BLAKE2b-256 2b3880fc8b61f35554fab5a6574bd019b8018090d851271c67489475b943d5e2

See more details on using hashes here.

File details

Details for the file cubature-0.18.8-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: cubature-0.18.8-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 10.5 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for cubature-0.18.8-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 fd1581441eeca729f1ce07b21bea1a30af5107a8816540284fad1fc9b42ac8ee
MD5 900471cf8fdcf8144843cc257195a71b
BLAKE2b-256 bdc168cb3299a29d32671feac5b211c04e3c30488bb21f00a1e594d4e8dce97a

See more details on using hashes here.

File details

Details for the file cubature-0.18.8-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cubature-0.18.8-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d73eb65d30eb81fbcdc6dd9d6cfcb24975b08efb46ccbebae53694e9c958002e
MD5 262f4e7f4592a9eb85fcdd2a40d813b5
BLAKE2b-256 97e287219c7c3c8a173391159130db540ab6fd6f3fd2aab8bc43b3c43b2ff03a

See more details on using hashes here.

File details

Details for the file cubature-0.18.8-cp311-cp311-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for cubature-0.18.8-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 fbe3bf7444653d4da6ca07becc28bf45f6b1335b6cc958855d9afdc24fc70d8d
MD5 2ccb181bf8fde52febf91d6b91cb098a
BLAKE2b-256 d8ea15b04106483351301351d617273b3d6dc6e475a2bb6b90f3974ed3d77bd0

See more details on using hashes here.

File details

Details for the file cubature-0.18.8-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: cubature-0.18.8-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 10.5 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.11

File hashes

Hashes for cubature-0.18.8-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 8f82851a3168a6885c87060c40cf1b639c362684f9b61f8035fc354dd9ea59d3
MD5 0857acc7f2546530f4966ed09e196715
BLAKE2b-256 00016fd87843db86a61cc8b85e0c48700e689b896e7f3e22618393b34b5371f7

See more details on using hashes here.

File details

Details for the file cubature-0.18.8-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cubature-0.18.8-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d90621e8056bb3768e9e3ea34ff12bea4169cca89512b02308798b00f539c055
MD5 91b64b7e6dd1a8c03e063e5ef5fcbc84
BLAKE2b-256 a10127bced95b680d1c618b48147dfb6eeb20558397a9efa3299f65d343ccd9b

See more details on using hashes here.

File details

Details for the file cubature-0.18.8-cp310-cp310-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for cubature-0.18.8-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 47bb1e91c30b6a7377ad6dfa6c20dcd2d0b057e08390509cbb4aad43fcedd581
MD5 5a3d8bb264b3144ae300d107503fb09d
BLAKE2b-256 d54bf47925e55ab71e1959adf53ca4c6f55a4d62c7c27b13daa555e3485666ce

See more details on using hashes here.

File details

Details for the file cubature-0.18.8-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: cubature-0.18.8-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 10.5 MB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.13

File hashes

Hashes for cubature-0.18.8-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 479ccbab651c903c63f1c58b926cddf1bedf73b7e63f8e6a3ac80c18654b1a53
MD5 9e02cf137b67dbf61e6a5cd9013a0bae
BLAKE2b-256 5b2d77051854e96bd9760d1c7a56424c385ce1c3724e3f002c3a580e092dbfc6

See more details on using hashes here.

File details

Details for the file cubature-0.18.8-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cubature-0.18.8-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 77af2ebb6f6e39a7b3c5335ba4d1a0c2306a08772b57c67db03c9413abc1be3b
MD5 9d7476fc481519af80f6eef0cfa24993
BLAKE2b-256 5647ee774054ca372bb06b2af34974763ab2eafd6f067b9893ed91b4d0544c08

See more details on using hashes here.

File details

Details for the file cubature-0.18.8-cp39-cp39-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for cubature-0.18.8-cp39-cp39-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 de8e54afa62dd97570e708bb8114ea0d0dddaa197321618611036f7a7685b60e
MD5 2a4cdb1f87928c1e7bf53bd93d559621
BLAKE2b-256 b2ff50977626a260b2eeebd0bcad90e271b1d620d08d6115bb3d5799d23dcbdc

See more details on using hashes here.

File details

Details for the file cubature-0.18.8-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: cubature-0.18.8-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 10.5 MB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.10

File hashes

Hashes for cubature-0.18.8-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 25f1eaae6cc89a7ba095f1e3b112706568e6d70839b51a67858454a42dce7cb4
MD5 e0b9a9d5b0f4a375162528cd437ddb90
BLAKE2b-256 b476406472ec8f5094300b66513259918725190bdc9f050aa80d370b724b9695

See more details on using hashes here.

File details

Details for the file cubature-0.18.8-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cubature-0.18.8-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c4f59f09e5c1d240320e6bf987c9f142134f7655f6a972650a6321068ad10528
MD5 b521eb0e309e19140e4666c95d221f46
BLAKE2b-256 b5855e75f9105b5df521379d37000c2a288a8fc8f7b4e9844d199a90a8db46ff

See more details on using hashes here.

File details

Details for the file cubature-0.18.8-cp38-cp38-macosx_11_0_universal2.whl.

File metadata

File hashes

Hashes for cubature-0.18.8-cp38-cp38-macosx_11_0_universal2.whl
Algorithm Hash digest
SHA256 440f1af72adea0d963c4ea164ea6a26560b74d9a26c6686b1988ceaab9eb713a
MD5 587ac57ecc1bd12c1578b4b9331c3315
BLAKE2b-256 59ad3e80bafa975d9c97c034a42d5930f56ebef00999a9511a6bc6838dc6c359

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page