Skip to main content

A unified mathematical framework for geometric computation

Project description

Morphis

A unified mathematical framework for geometric computation, providing elegant tools for working with geometric algebra, manifolds, and their applications across mathematics and physics. The name derives from Greek morphe (form) — embodying the transformation and adaptation of geometric structures across different contexts while preserving their essential nature.

4D rotations animation

A 4D orthonormal frame rotating through bivector planes, projected to 3D. The view switches between e₁e₂e₃ and e₂e₃e₄ projections mid-animation.

Features

  • Geometric Algebra Core: Blades, multivectors, and operations (wedge, geometric product, duality)
  • Metric-Aware: Objects carry their metric context (Euclidean, projective, etc.)
  • Linear Operators: Structured linear maps between blade spaces with SVD, pseudoinverse, least squares
  • Visualization: 3D rendering of blades with PyVista, timeline-based animation, 4D projection
  • Motor Transforms: Rotors and translations via sandwich product

Installation

Requires Python 3.12+.

pip install morphis

From Source

git clone https://github.com/ctl-alt-leist/morphis.git
cd morphis
make install

Project Structure

morphis/
├── src/morphis/
│   ├── elements/       # Core GA objects: Blade, MultiVector, Frame, Operator, Metric
│   │   └── tests/
│   ├── algebra/        # Linear algebra: BladeSpec, einsum patterns, solvers
│   │   └── tests/
│   ├── operations/     # GA operations: wedge, geometric product, duality, norms
│   │   └── tests/
│   ├── transforms/     # Rotors, translators, PGA, motor constructors
│   │   └── tests/
│   ├── visuals/        # PyVista rendering, animation, themes
│   │   └── drawing/    # Blade mesh generation
│   ├── examples/       # Runnable demos
│   └── utils/          # Easing functions, observers, pretty printing
├── docs/               # Design documents
├── pyproject.toml      # Project configuration
├── Makefile            # Development commands
└── ruff.toml           # Linting configuration

Development

This project uses uv for Python project management.

Setup

make install    # Create venv, install dependencies, setup pre-commit hooks

Or step by step:

make setup      # Create venv and sync dependencies
uv run pre-commit install  # Install git hooks

Common Commands

Command Description
make lint Format and lint code with ruff
make test Run tests with pytest
make build Build distribution packages
make clean Remove generated files and caches
make reset Clean and reinstall from scratch

Testing

Tests are co-located with source in tests/ subdirectories:

make test                                # Run all tests
uv run pytest src/morphis/elements -v    # Run specific module tests

Code Style

  • Python 3.12+ with type hints
  • Ruff for formatting and linting
  • Pre-commit hooks run automatically on commit

Release Workflow

Releases are triggered by git tags. When a tag matching v* is pushed, GitHub Actions automatically builds and publishes to PyPI.

To Release a New Version

  1. Update version in pyproject.toml
  2. Commit the change
  3. Run make publish
# Example: releasing version 0.2.0
# Edit pyproject.toml: version = "0.2.0"
git add pyproject.toml
git commit -m "Bump version to 0.2.0"
make publish

The make publish command will:

  • Read the version from pyproject.toml
  • Create a git tag v{version}
  • Push the tag to trigger the release workflow

License

MIT License - see LICENSE file for details.


Claude Code was used in the development of this project.

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

morphis-0.4.0.tar.gz (123.7 kB view details)

Uploaded Source

Built Distribution

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

morphis-0.4.0-py3-none-any.whl (158.3 kB view details)

Uploaded Python 3

File details

Details for the file morphis-0.4.0.tar.gz.

File metadata

  • Download URL: morphis-0.4.0.tar.gz
  • Upload date:
  • Size: 123.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for morphis-0.4.0.tar.gz
Algorithm Hash digest
SHA256 805c78d7820097256d1d5e0e585ed08e71396e134cd69590cf241ebaf4bfc71f
MD5 31334e14dc6f1c45a6fee8fbc5ce1a15
BLAKE2b-256 00298164bc5b3d624a6b16b0f60f3b52ba2abbf077cf5d9c5cd537193d9a3ae7

See more details on using hashes here.

File details

Details for the file morphis-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: morphis-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 158.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for morphis-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 019b25067c9a11a65b559b2df9645b6ef6c473e45f611c8300f15a2ad597ece2
MD5 d24d7a8b356e3370f40215e2964a414f
BLAKE2b-256 a0f429292b0fb7ddfe6f895a228844947c242ceb99227bd52ae8e8783ff2364d

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