- 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
For end user, it is just a pip installation
pip install attractors
Note that attractors depends on numba, so the system must be able to compile it. If any issues arise, look at numba installation docs.
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.
In spirit of open source code - MIT License