Skip to main content

A package for simulation and visualization of strange attractors

Project description

attractors

in chaos, emerges beauty

A package for simulation and visualization of strange attractors.

codecov Actions status PyPI - Version PyPI - Python Version

Core Features

  • A curated collection of 20+ strange attractors including classics and rare gems
  • High-performance numerical solving using Numba-accelerated Runge-Kutta solvers
  • Stunning visualizations with various themes and color mappings
  • Modular design that welcomes extensions and experimentation

Read the full creator's note here

[!NOTE] The version 2.x of attractors is a complete rewrite and is not backward compatible with the previous versions. Especially the API has been completely revamped, and the CLI support has been removed (though it might be added back in the future). If you are looking for the older version, you can find it in the v1-legacy branch and its related documentation

Setup

For end user, it is just a pip installation

pip install attractors

Requirements: Python 3.11+ with NumPy 2.2+, Numba 0.63+, and Matplotlib 3.10+

Note that attractors depends on numba, so the system must be able to compile it. If any issues arise, look at numba installation docs.

Basic Usage

In v2.x of attractors, registries are introduced to facilitate easier creation and usage of existing as well as new, custom systems solvers and themes. The following simple script demonstrates that well:

from attractors import SystemRegistry, SolverRegistry, integrate_system
import matplotlib.pyplot as plt
from attractors.visualizers import StaticPlotter
from attractors.themes import ThemeManager

# Get system and solver from registry
system = SystemRegistry.get("lorenz")  # Using default parameters
solver = SolverRegistry.get("rk4")     # 4th order Runge-Kutta

# Generate trajectory
trajectory, time = integrate_system(system, solver, steps=10000, dt=0.01)

# Create visualization
theme = ThemeManager.get("nord")  # Using Nord color theme
plotter = StaticPlotter(system, theme)
plotter.visualize(trajectory)
plt.show()

Check out some examples for more inspiration. The banner.py for example was the code used to generate the README banner!

For a deeper dive into the package's capabilities, explore the complete documentation.

License

In spirit of open source code - MIT License

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

attractors-2.0.1.tar.gz (24.8 kB view details)

Uploaded Source

Built Distribution

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

attractors-2.0.1-py3-none-any.whl (40.2 kB view details)

Uploaded Python 3

File details

Details for the file attractors-2.0.1.tar.gz.

File metadata

  • Download URL: attractors-2.0.1.tar.gz
  • Upload date:
  • Size: 24.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for attractors-2.0.1.tar.gz
Algorithm Hash digest
SHA256 73cd3101326a013a12f5e1837fe325547bf0a8027286ecefc48eba8b9332413e
MD5 c0319a4a5fec895656199ebc97d3c9c0
BLAKE2b-256 e5cdacc8257cfde047ca239f0e0187c0cdde86870d7d0290a014a9f831540fb3

See more details on using hashes here.

Provenance

The following attestation bundles were made for attractors-2.0.1.tar.gz:

Publisher: cd.yml on vdesmond/attractors

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file attractors-2.0.1-py3-none-any.whl.

File metadata

  • Download URL: attractors-2.0.1-py3-none-any.whl
  • Upload date:
  • Size: 40.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for attractors-2.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1f76d47a60c98115afb658f1e8977ce4bac1d529b5b4adcd9b6041866aabd3f7
MD5 65a0f9130ddee8ad87071bcbb52b79af
BLAKE2b-256 a9ebadc0143c0531fc2c747297f48c46b352d8ff5b40169cf1fe6bf8e4b2da5f

See more details on using hashes here.

Provenance

The following attestation bundles were made for attractors-2.0.1-py3-none-any.whl:

Publisher: cd.yml on vdesmond/attractors

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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