Consider the recurrence relation
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 .
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 is available on readthedocs.io, with a pdf format available here.