Skip to main content

An API to animate the Simon fractal

Project description

attractor

attractor is a Python module for animating and analyzing the Simon fractal using efficient rendering techniques. It provides a clean API to generate frames, apply mathematical transformations, 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/yourusername/attractor.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.0.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.0-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: attractor_tools-0.1.0.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.0.tar.gz
Algorithm Hash digest
SHA256 0c876ebb3c2667353698b9d1c06f9bf44efda501b4ffdfdb805b5b58cdf61294
MD5 8bf7007bf7d4def0631446f746066191
BLAKE2b-256 1f84d50ffa2217a90ed145b4350dd31574c0e1a77cca0bbe99b9d11ee668b006

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for attractor_tools-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 419a99ed20a84049da608225861cb06ece50d45e2e99a63e6cdcf73f91ce1887
MD5 11e336c8b155937737bf3276f357a59f
BLAKE2b-256 de659709c2080684fb80ed4555eb02740a5a6d4ae0e3eebedd5d6169af0d77a5

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