pymandel package
Submodules
pymandel.about_dialog module
About Dialog Box class for tkinter application.
Created on 3 Apr 2020
- author:
semuadmin
- copyright:
SEMU Consulting © 2020
- license:
GPL3
This file is part of PyMandel.
PyMandel is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
PyMandel is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with PyMandel. If not, see <https://www.gnu.org/licenses/>.
pymandel.app module
Mandelbrot generator - Main tkinter application class
Created on 29 Mar 2020
- author:
semuadmin
- copyright:
SEMU Consulting © 2020
- license:
GPL3
This file is part of PyMandel.
PyMandel is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
PyMandel is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with PyMandel. If not, see <https://www.gnu.org/licenses/>.
pymandel.fractal_frame module
Fractal frame class for tkinter application.
This handles all the user interaction (mouse and key clicks) and image mechanics.
Created on 3 Apr 2020
- author:
semuadmin
- copyright:
SEMU Consulting © 2020
- license:
GPL3
This file is part of PyMandel.
PyMandel is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
PyMandel is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with PyMandel. If not, see <https://www.gnu.org/licenses/>.
- class pymandel.fractal_frame.FractalFrame(app, *args, **kwargs)[source]
Bases:
FrameFrame inheritance class for plotting area.
- plot()[source]
Plot Mandelbrot set as an ImageTk.PhotoImage and load this into the GUI’s Canvas widget for display.
- axes(width, height)[source]
Draw complex space axes on plot. Bit simple - only really works at low magnifications
- on_mouse_wheel(event)[source]
Zoom in and out using mouse wheel
Mouse wheel event.delta increment differs between Windows and MacOS/Linux platforms. These settings seem to work OK for Logitech and Apple wireless mice but may need to be tweaked for other devices
- on_left_click(event)[source]
Left-click - zoom in at cursor position (ZOOMIN mode). Left-click & Shift - zoom out (ZOOMOUT mode). Left-click & Ctrl-L or Alt-L - switch to Julia mode and plot Julia set corresponding to current cursor (cx, cy) position (GOJULIA mode).
- on_key_down(event)[source]
Left-click - zoom in at cursor position (ZOOMIN mode). Left-click & Shift - zoom out (ZOOMOUT mode). Left-click & Ctrl-L or Alt-L - switch to Julia mode and plot Julia set corresponding to current cursor (cx, cy) position (GOJULIA mode). Left or Right Arrow keys - in Julia mode, rotate Julia set about its origin
(for some reason tkinter doesn’t appear to recognise an Alt-L event on all Windows platforms)
- animate(animatemode)[source]
Generates and saves a series of frames at a specified offset. The individual frames can then be assembled into e.g. an animated .gif or short video using external tools.
Also used to generate a ‘Spinning Julia’ animation, rotating a Julia Set anti-clockwise around its origin.
pymandel.howto_dialog module
How To Dialog Box class for tkinter application.
Created on 19 Apr 2020
- author:
semuadmin
- copyright:
SEMU Consulting © 2020
- license:
GPL3
This file is part of PyMandel.
PyMandel is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
PyMandel is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with PyMandel. If not, see <https://www.gnu.org/licenses/>.
pymandel.mandelbrot module
Mandelbrot & Julia set class for tkinter application.
This handles the computation of the Mandelbrot or Julia set as a numpy rgb array which is loaded into a ImageTk.PhotoImage (and ultimately into a Tk.Canvas for viewing in the GUI).
NB: use of Numba @jit decorators and pranges to improve performance. For more information refer to http://numba.pydata.org.
Created on 29 Mar 2020
- author:
semuadmin
- copyright:
SEMU Consulting © 2020
- license:
GPL3
This file is part of PyMandel.
PyMandel is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
PyMandel is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with PyMandel. If not, see <https://www.gnu.org/licenses/>.
- pymandel.mandelbrot.plot(imagemap, settype, setvar, width, height, zoom, radius, exponent, zxoff, zyoff, maxiter, theme, shift, cxoff, cyoff)[source]
Plots selected fractal type in the numpy rgb array ‘imagemap’
- pymandel.mandelbrot.fractal(settype, setvar, width, height, x_axis, y_axis, zxoff, zyoff, zoom, maxiter, radius, exponent, cxoff, cyoff)[source]
Calculates fractal escape scalars i, za for each image pixel and returns them for use in color rendering routines.
- pymandel.mandelbrot.ptoc(width, height, x, y, zxoff, zyoff, zoom)[source]
Converts actual pixel coordinates to complex space coordinates (zxoff, zyoff are always the complex offsets).
- pymandel.mandelbrot.ctop(width, height, zx_coord, zy_coord, zxoff, zyoff, zoom)[source]
Converts complex space coordinates to actual pixel coordinates (zxoff, zyoff are always the complex offsets).
- pymandel.mandelbrot.get_color(i, za, radius, maxiter, theme, shift)[source]
Uses escape scalars i, za from the fractal algorithm to drive a variety of color rendering algorithms or ‘themes’.
NB: If you want to add more rendering algorithms, this is where to add them, but you’ll need to ensure they are ‘Numba friendly’ (i.e. limited to Numba-recognised data types and suitably decorated library functions).
- pymandel.mandelbrot.sel_colormap(i, za, radius, shift, theme)[source]
Select from indexed colormap theme
- pymandel.mandelbrot.get_colormap(i, za, radius, shift, colmap)[source]
Get pixel color from colormap
- pymandel.mandelbrot.normalize(i, za, radius)[source]
Normalize iteration count from escape scalars to produce smoother color gradients.
- pymandel.mandelbrot.interpolate(col1, col2, ni)[source]
Linear interpolation between two adjacent colors in color palette.
- pymandel.mandelbrot.hsv_to_rgb(h, s, v)[source]
Convert HSV values (in range 0-1) to RGB (in range 0-255).
- class pymandel.mandelbrot.Mandelbrot(master)[source]
Bases:
objectMain computation and imaging class.
pymandel.mandelcli module
Mandelbrot generator
A command line utility which invokes the Mandelbrot class methods to create a sequence of Mandelbrot images as .png files. It is the command line equivalent of the GUI Animate function, but can also be used to generate single, very high resolution images.
Can also import settings from a previously saved metadata file.
Created on 29 Mar 2020
- author:
semuadmin
- copyright:
SEMU Consulting © 2020
- license:
GPL3
This file is part of PyMandel.
PyMandel is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
PyMandel is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with PyMandel. If not, see <https://www.gnu.org/licenses/>.
pymandel.settings_frame module
Settings frame class for tkinter application.
This handles all the settings and file storage/retrieval.
Created on 3 Apr 2020
- author:
semuadmin
- copyright:
SEMU Consulting © 2020
- license:
GPL3
This file is part of PyMandel.
PyMandel is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
PyMandel is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with PyMandel. If not, see <https://www.gnu.org/licenses/>.
- class pymandel.settings_frame.SettingsFrame(app, *args, **kwargs)[source]
Bases:
FrameFrame inheritance class for application settings and controls.
- val_settings(*args, **kwargs)[source]
Validate all user-entered settings. (A personal choice but I find this user experience more intuitive than the standard validatecommand method for Entry widgets)
- flag_entry(ent, flag)[source]
Flag entry field as valid or invalid and set global validity status flag. This flag is used throughout to determine whether functions can proceed or not.
- set_sel_theme()[source]
Lookup index of selected theme and highlight that listbox position. NB: this requires ‘exportselection=False’ option to be set on listbox to work properly.
- save_image()[source]
Save image as PNG file to selected filepath and automatically increment default image name. NB: currently this will overwrite any existing file of the same name without warning.
pymandel.status_frame module
Status Bar frame class for tkinter application.
This handles the status bar notifications.
Created on 7 Apr 2020
- author:
semuadmin
- copyright:
SEMU Consulting © 2020
- license:
GPL3
This file is part of PyMandel.
PyMandel is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
PyMandel is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with PyMandel. If not, see <https://www.gnu.org/licenses/>.
pymandel.strings module
ENGLISH language string literals for PyMandel tkinter application
Created on 22 Apr 2020
- author:
semuadmin
- copyright:
SEMU Consulting © 2020
- license:
GPL3
This file is part of PyMandel.
PyMandel is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
PyMandel is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with PyMandel. If not, see <https://www.gnu.org/licenses/>.
pymandel.stringsDE module
DEUTSCHE Sprachzeichenfolgenliterale für die PyMandel tkinter-Anwendung
Erstellt am 22. April 2020
@author: semuadmin
pymandel.stringsEN module
ENGLISH language string literals for PyMandel tkinter application
Created on 22 Apr 2020
@author: semuadmin
pymandel.stringsES module
Literales de cadena de idioma ESPAÑOL para la aplicación PyMandel tkinter
Creado el 22 abr 2020
@autor: semuadmin
pymandel.stringsFR module
Littéraux de chaîne de langue FRANCAIS pour l’application PyMandel tkinter
Créé le 22 avr 2020
@author: semuadmin
Module contents
Created on 27 Sep 2020
- author:
semuadmin
- copyright:
SEMU Consulting © 2020
- license:
GPL3
This file is part of PyMandel.
PyMandel is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
PyMandel is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with PyMandel. If not, see <https://www.gnu.org/licenses/>.