Skip to main content

pip install version python versions build status last commit open pull requests

This is an active fork of blmath, a collection math-related utilities developed at Body Labs.

The fork’s goals are moderate:

  • Keep the library working in current versions of Python and other tools.

  • Make bug fixes.

  • Provide API stability and backward compatibility with the upstream version.

  • Add additional functionality which relates well to what is here.

  • Respond to community contributions.

It’s used by related forks such as lace.

Installation

Install dependencies

On macOS:

brew install homebrew/science/suite-sparse
brew install homebrew/science/opencv --without-numpy

On Linux:

sudo apt-get install python-opencv libsuitesparse-dev

Install the library

pip install metablmath

And import it just like the upstream library:

from blmath.numerics import vx

A collection of math related utilities used by many bits of BodyLabs’ code.

blmath.numerics

Functions for manipulating numeric arrays, numbers, and linear algebra.

The most commonly used of these are directly imported into blmath.numerics.

  • blmath.numerics.vx is a namespace of common linear algebra operations. These are easily expressed in numpy, but abstracted for readability purposes.

  • blmath.numerics.coercion contains a validation function as_numeric_array, which produces useful error messages up front on bad inputs, in place of cryptic messages like “cannot broadcast…” later on.

  • blmath.numerics.operations contains basic numerical operations such as zero_safe_divide.

  • blmath.numerics.predicates contains functions like isnumeric.

  • blmath.numerics.rounding contains functions including “round to nearest” and roundedlist.

  • blmath.numerics.numpy_ext contains numpy utility functions.

  • blmath.numerics.matlab contains some matlab shortcuts which have no numpy equivalent. At MPI the fitting code was originally written in Matlab before it was ported to Python.

blmath.numerics.linalg contains linear algebra operations.

blmath.geometry

Geometric operations, transforms, and primitives, in 2D and 3D.

The most commonly used of these are directly imported into blmath.geometry.

blmath.geometry.transform includes code for 3D transforms.

Other modules:

blmath.value

Class for wrapping and manipulating value/units pairs.

blmath.units

TODO write something here

blmath.console

Development

pip install -r requirements_dev.txt
pip install -e .  # builds the native extension
rake unittest
rake lint

Contribute

Pull requests welcome!

Support

If you are having issues, please let us know.

Acknowledgements

This collection was developed at Body Labs and includes a combination of code developed at Body Labs, from legacy code and significant new portions by Eric Rachlin, Alex Weiss, and Paul Melnikow. It was extracted from the Body Labs codebase and open-sourced by Alex Weiss.

License

The project is licensed under the two-clause BSD license.

Metadata

Release files for metablmath 1.2.5.post2

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

Source distribution (sdist)

Source distribution for metablmath 1.2.5.post2
File Size Uploaded Provenance Actions
metablmath-1.2.5.post2.tar.gz 54.7 kB Without provenance Details for metablmath-1.2.5.post2.tar.gz

Release files / metablmath-1.2.5.post2.tar.gz

Download URL metablmath-1.2.5.post2.tar.gz
Size 54.7 kB
Tags Source
SHA-256 checksum
How to use checksums
31d428bb95574b9f77dce7a25fc4d5cbb37abeed4799c63aa6cbd2e3179b9a84
BLAKE2b-256 checksum
How to use checksums
21982cb025b49c35c91f4e8700c3e362eea4cdd2fcf87ed61ea52c5ba706ad84
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/38.5.1 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.6.4

Security for metablmath 1.2.5.post2

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