Skip to main content

An API to animate the Simon fractal

Project description

Attractor Tools

Attractor-tools is a Python module for animating the Simon fractal using efficient rendering. It provides a clean API to generate frames, assinging colormaps, and export visualizations as videos.


✨ Features

  • Animate the Simon fractal with customizable parameters
  • NumPy, Numba and Multiprocessing for performance

📦 Installation

Clone the repo and install in editable mode for development:

git clone https://github.com/beasty79/attractor_api.git
cd attractor
pip install -e .

Example usage

from attractor import sinspace, Performance_Renderer, ColorMap

def main():
    # Create an array of values following a sinewave (period = 1)
    # works jsut the same as np.linspace(start, end, n)
    # similar function are cosspace, bpmspace
    a = sinspace(0, 1, 100)

    # Initialize the main renderer
    renderer = Performance_Renderer(
        a=a,
        b=1.5,
        colormap=ColorMap("viridis"),
        frames=len(a),
    )

    # Important: mark 'a' as non-static (varies per frame)
    renderer.set_static("a", False)

    # Start rendering to a video file using 4 threads
    renderer.start_render_process("./your_file_path/your_filename.mp4", threads=4, chunksize=4)

if __name__ == "__main__":
    main()

Attractor Visualization API

Overview

This package provides tools for generating and rendering dynamic attractor visualizations using customizable color maps and performance-optimized rendering techniques.

API

  • render_frame Core function to compute attractor frame data.

  • Performance_Renderer High-performance renderer supporting multi-threaded frame generation and video output.

Utility Functions

  • ColorMap Utility class to create and manage color maps with optional inversion.

  • sinspace / cosspace Generate smooth sine- or cosine-shaped value sequences over a specified range.

  • bpmspace Create time-based sequences synced to beats per minute (BPM) for rhythmic animations.

  • map_area Batch process and render attractor animations over a grid of parameters.

  • apply_colormap Apply a color map to attractor data to produce a colored image.

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

attractor_tools-0.1.1.tar.gz (10.2 kB view details)

Uploaded Source

Built Distribution

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

attractor_tools-0.1.1-py3-none-any.whl (10.1 kB view details)

Uploaded Python 3

File details

Details for the file attractor_tools-0.1.1.tar.gz.

File metadata

  • Download URL: attractor_tools-0.1.1.tar.gz
  • Upload date:
  • Size: 10.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for attractor_tools-0.1.1.tar.gz
Algorithm Hash digest
SHA256 550f8b78da641cb6e78651f9924f9ddc04122d6b51f47e3aaed61ac905bd7b43
MD5 89d78bf3723bb2aaa17db898bec64023
BLAKE2b-256 72e955f74e3a99b1a6345cf60045c279ca9499395b78ac5269bbab439ef022c4

See more details on using hashes here.

File details

Details for the file attractor_tools-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for attractor_tools-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3fd9832977706292aa09d4ec49402dd4f5ba02a9a0de323bbc0bbbc5cf2ee2fd
MD5 bc915afd15f7b55ce16b1f0d37b44935
BLAKE2b-256 cc72cc2a35e73fea48e64ef209d387c4a4ac47c8cba9eaceaf25c8b7f9f2bbee

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