Skip to main content

FractalPy

pypi tag python_version licence code quality build checks codecov docs

Consider the recurrence relation $z_{n+1} = z_n^2 + c$ where $c$ is a complex number. The Mandelbrot set is a fractal, defined by the set of complex numbers $c$ for which this recurrence relation, with initial value $z_0 = 0$, does not diverge. Another interesting type of set, which are related to the Mandelbrot set, are Julia sets and are defined for a specific complex number $c$. To keep things brief, we will just establish the definition of a filled-in Julia set and do so in the following way: The filled-in Julia set of a complex number $c$ is the set of initial values $z_0$ for which the previously mentioned recurrence relation does not diverge. Not every filled-in Julia set is a fractal, but for almost all complex numbers $c$, they are. This project contains an implementation to generate images and videos relating to the Mandelbrot set and Julia sets.

Installation

Before installing the FractalPy package, it is recommended to create and activate a virtual environment with python 3.10. This can be done with conda by running the following commands in a terminal

$ conda create --name fractal python==3.10
$ conda activate fractal

Now the package and it's dependencies can be installed in the virtual environment, fractal, using pip.

To install the stable release, run

$ pip install fractalpy

To install the latest version, run

$ pip install git+https://github.com/Fergus-OH/FractalPy.git

To install an editable installation, clone the repository, checkout the develop branch, and install the contents with pip. This can be done with the following commands

$ git clone --branch develop https://github.com/Fergus-OH/FractalPy.git
$ cd FractalPy
$ pip install -e .

Usage

To get started with FractalPy, type the following in a terminal to show documentation for the command line interface application

$ fractalpy --help

FractalPy can be also be used directly in a notebook or python script by importing the fractalpy package

There are two ways of using FractalPy. The package can be imported to a python script with

import fractalpy as frac

# Plot the Mandelbrot set
frac.Mandelbrot().plot()

# Plot the Julia set
frac.Julia().plot()

The package also offers a command line interface that can be immediately accessed in the terminal with

fractalpy --help

For example, we can create a gif of zooming into the mandelbrot set with the following command:

fractalpy mandelbrot zoom

If FFmpeg is installed and accessible via the $PATH environment variable, then FractalPy can also generate videos, for example

fractalpy mandelbrot zoom --extension mp4

FractalPy makes use of multiprocessing to generate multiple frames simultaneously and also performs the computationally expensive calculations in parallel with jit, making it an extremely fast.

Documentation

Documentation is available on readthedocs.io, with a pdf format available here.

Metadata

Release files for fractalpy 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fractalpy 0.1.1
File Size Uploaded
fractalpy-0.1.1.tar.gz 13.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fractalpy 0.1.1
File Interpreter ABI Platform
fractalpy-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 27.3 kB

Release files / fractalpy-0.1.1.tar.gz

Download URL fractalpy-0.1.1.tar.gz
Size 13.1 kB
Tags Source
SHA-256 checksum
How to use checksums
397d3660e548bf19069849c34e91d4907f859ecf9f86884ad0060e26aa422a77
BLAKE2b-256 checksum
How to use checksums
45d3506f7824283a519ba6b1b76ed00346d2245cf98493ca80b62eb60ec35b5a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.3.2 CPython/3.11.1 Darwin/22.2.0

Release files / fractalpy-0.1.1-py3-none-any.whl

Download URL fractalpy-0.1.1-py3-none-any.whl
Size 14.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0349b423d4092db9f7a22f280725a83ac1eda5cdd5bedce2154182a7f033fd2e
BLAKE2b-256 checksum
How to use checksums
c6809925d077503df5853c5b4b781dc5b89b413a434933135e7b347437542284
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.3.2 CPython/3.11.1 Darwin/22.2.0

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page