Sage: Ticket #23257: Plotting the Mandelbrot set in Sage
https://trac.sagemath.org/ticket/23257
<p>
This ticket is the first in a series of tickets that will be opened this summer in an effort to improve the functionality for complex dynamics in Sage. I have added complex_dynamics folder to the dynamics folder that introduces the function mandelbrot_plot() which allows users to produce an interactive plot of the Mandelbrot set. For more information on my Google Summer of Code Project you can visit the following link: <a class="ext-link" href="https://benbarros.wordpress.com/"><span class="icon"></span>https://benbarros.wordpress.com/</a>
</p>
en-usSagehttps://trac.sagemath.org/chrome/site/logo_sagemath_trac.png
https://trac.sagemath.org/ticket/23257
Trac 1.1.6bbarrosFri, 16 Jun 2017 13:46:56 GMTbranch set
https://trac.sagemath.org/ticket/23257#comment:1
https://trac.sagemath.org/ticket/23257#comment:1
<ul>
<li><strong>branch</strong>
set to <em>u/bbarros/23257</em>
</li>
</ul>
TicketbbarrosFri, 16 Jun 2017 13:48:18 GMTstatus changed; commit set
https://trac.sagemath.org/ticket/23257#comment:2
https://trac.sagemath.org/ticket/23257#comment:2
<ul>
<li><strong>status</strong>
changed from <em>new</em> to <em>needs_review</em>
</li>
<li><strong>commit</strong>
set to <em>023321fa6b77e9f749c0fb020bd85c41d9ca8858</em>
</li>
</ul>
<p>
New commits:
</p>
<table class="wiki">
<tr><td><a class="ext-link" href="https://git.sagemath.org/sage.git/commit?id=023321fa6b77e9f749c0fb020bd85c41d9ca8858"><span class="icon"></span>023321f</a></td><td><code>Added complex_dynamics folder for plotting Mandelbrot set</code>
</td></tr></table>
TicketbhutzFri, 16 Jun 2017 18:23:29 GMTpriority, status, keywords changed; cc, reviewer set
https://trac.sagemath.org/ticket/23257#comment:3
https://trac.sagemath.org/ticket/23257#comment:3
<ul>
<li><strong>priority</strong>
changed from <em>major</em> to <em>minor</em>
</li>
<li><strong>status</strong>
changed from <em>needs_review</em> to <em>needs_work</em>
</li>
<li><strong>cc</strong>
<em>atowsley</em> added
</li>
<li><strong>keywords</strong>
<em>gsoc2017</em> <em>complexdynamics</em> added; <em>GSoC</em> <em>complex</em> <em>dynamics</em> removed
</li>
<li><strong>reviewer</strong>
set to <em>Ben Hutz</em>
</li>
</ul>
<p>
First, some general things:
</p>
<ul><li>don't include the helper file in the documentation (rst)
</li></ul><ul><li>also do not add the pyx extension since the helper functions aren't exposed to the user
</li></ul><ul><li>I'd add to the ticket description that this is the first of a series improving the complex dynamics functionality.
</li></ul><hr />
<p>
for the .py file
</p>
<ul><li>OUTPUT: - isn't this a .bmp or an interact?
</li></ul><ul><li>kwds go under an INPUT: section
</li></ul><ul><li>add some readability spacing, such as after , for arguments
<pre class="wiki">kwds.pop("x_center", -1.0)
</pre></li></ul><ul><li>I don't understand the section 'NOTEBOOK EXAMPLES:'. Seems like this is all self-explanatory from the kwds description. The actual function call examples are needed, but they should be in an EXAMPLES: section
</li></ul><ul><li>I would add some to more the general function description:
<ul><li>what is the mandelbrot set
</li><li>how are you computing it (perhaps a very basic ALGORITHM: section)
</li></ul></li></ul><hr />
<p>
for the .pyx file
</p>
<ul><li>I don't think you need the initial underscore (that marks it as a private function that won't appear in tab completion) since it is not exposed to the user anyway.
</li></ul><ul><li>need one line description of function
</li></ul><ul><li>why not a cdef?
</li></ul><ul><li>OUTPUT - isn't this a .bmp
</li></ul><ul><li>The examples fail because you need to import the function first
</li></ul><pre class="wiki">sage: from sage.dynamics.complex_dynamics.mandel_julia_helper import _fast_mandel_plot
</pre><ul><li>bug: negative image_width flips the image instead of gives an error
</li></ul><hr />
<p>
a couple functionality thoughts:
</p>
<p>
for interact:
</p>
<ul><li>I'd let the user adjust pretty much anything
</li></ul><ul><li>I still don't really like the width slider. How about a input box?
</li></ul><p>
for colors: the contour levels are not great by default. I was playing around with it and the best I could come up with using basically the same system was as follows
</p>
<p>
have two parameters
</p>
<ul><li>number of iterations between levels (default to 1)
</li></ul><ul><li>number of colors to use
</li></ul><p>
you'll need to do better with your nested ifs. For example
</p>
<pre class="wiki">cdef int level
if iteration != max_iteration:
level = iteration/level_sep
if level < color_num:
pixel[row,col] = color_list[level]
else:
pixel[row,col] = color_list[-1]
</pre><p>
This gave me pretty good control over the contours and I got a nice grey-scale image with base_color [50,50,50] with level_sep=1 and 20 colors gradations. This has the advantage of disengaging it from the max_iterations. So you can increase the detail without messing up the contours.
</p>
<p>
I'll leave the default color choice to you, but at least consider gray scale since it should allow a 'white' external ray to show up well.
</p>
TicketbbarrosFri, 16 Jun 2017 21:12:39 GMTdescription changed
https://trac.sagemath.org/ticket/23257#comment:4
https://trac.sagemath.org/ticket/23257#comment:4
<ul>
<li><strong>description</strong>
modified (<a href="/ticket/23257?action=diff&version=4">diff</a>)
</li>
</ul>
TicketbbarrosFri, 16 Jun 2017 21:14:54 GMTdescription changed
https://trac.sagemath.org/ticket/23257#comment:5
https://trac.sagemath.org/ticket/23257#comment:5
<ul>
<li><strong>description</strong>
modified (<a href="/ticket/23257?action=diff&version=5">diff</a>)
</li>
</ul>
TicketgitWed, 21 Jun 2017 19:00:13 GMTcommit changed
https://trac.sagemath.org/ticket/23257#comment:6
https://trac.sagemath.org/ticket/23257#comment:6
<ul>
<li><strong>commit</strong>
changed from <em>023321fa6b77e9f749c0fb020bd85c41d9ca8858</em> to <em>dbcd279521f5e5a76258981f4607bd4b4ad4ec90</em>
</li>
</ul>
<p>
Branch pushed to git repo; I updated commit sha1. New commits:
</p>
<table class="wiki">
<tr><td><a class="ext-link" href="https://git.sagemath.org/sage.git/commit/?id=dbcd279521f5e5a76258981f4607bd4b4ad4ec90"><span class="icon"></span>dbcd279</a></td><td><code>Updated and debugged complex_dynamics files</code>
</td></tr></table>
TicketbbarrosWed, 21 Jun 2017 19:04:10 GMTstatus changed
https://trac.sagemath.org/ticket/23257#comment:7
https://trac.sagemath.org/ticket/23257#comment:7
<ul>
<li><strong>status</strong>
changed from <em>needs_work</em> to <em>needs_review</em>
</li>
</ul>
<p>
I pushed an updated branch with the changes made. I did not change the function in the .pyx file to a cdef because whenever I try to import it as a cdef (using or cimport or just import) I am unable to import it. If you have any ideas of how to get that to work I would love to hear them. Please let me know what else I need to fix.
</p>
TicketgitThu, 22 Jun 2017 18:39:59 GMTcommit changed
https://trac.sagemath.org/ticket/23257#comment:8
https://trac.sagemath.org/ticket/23257#comment:8
<ul>
<li><strong>commit</strong>
changed from <em>dbcd279521f5e5a76258981f4607bd4b4ad4ec90</em> to <em>bcb3792080656f66a79b3c88b8b8680380db185c</em>
</li>
</ul>
<p>
Branch pushed to git repo; I updated commit sha1. New commits:
</p>
<table class="wiki">
<tr><td><a class="ext-link" href="https://git.sagemath.org/sage.git/commit/?id=bcb3792080656f66a79b3c88b8b8680380db185c"><span class="icon"></span>bcb3792</a></td><td><code>23257: Fixed syntax and doctests</code>
</td></tr></table>
TicketbhutzFri, 23 Jun 2017 13:24:01 GMTstatus changed
https://trac.sagemath.org/ticket/23257#comment:9
https://trac.sagemath.org/ticket/23257#comment:9
<ul>
<li><strong>status</strong>
changed from <em>needs_review</em> to <em>needs_work</em>
</li>
</ul>
<p>
I think the functionality works well now. I have a few code nitpicks and one suggestion for speedup.
</p>
<p>
You also need to resolve the current merge conflict
</p>
<hr />
<p>
cython file:
</p>
<p>
import statements to top
</p>
<p>
line 89 too long
</p>
<p>
line 98: don't over do the spacing: 2*new_x*new_y + y_coor
</p>
<p>
add some comments describing what each code block is doing. for example, why are you reflecting about the x-axis. Are you trying to use that it is symmetrical? In that case you should be assigning two pixel values for each iteration and only looping through the top half of the pixels, but only when the real axis is contain in the image window.
</p>
<p>
speed ups: the quantities
</p>
<p>
image_width * (row-pixel_count / 2) / pixel_count
image_width * (col-pixel_count / 2) / pixel_count
</p>
<p>
are better off precomputed as step values
</p>
<hr />
<p>
python file
</p>
<p>
reference should go in the main reference file: src/doc/en/reference/references/index.rst
</p>
<p>
then you can reference it here as [Devaney]_
</p>
<p>
you also have several lines longer than the 80char standard. They should be wrapped.
</p>
<p>
several examples are missing the 'sage:' portion
</p>
<p>
imports to top of file
</p>
TicketgitFri, 23 Jun 2017 21:30:56 GMTcommit changed
https://trac.sagemath.org/ticket/23257#comment:10
https://trac.sagemath.org/ticket/23257#comment:10
<ul>
<li><strong>commit</strong>
changed from <em>bcb3792080656f66a79b3c88b8b8680380db185c</em> to <em>6a9f9531f02139f0d2d94c68dcd495902c8ac4e6</em>
</li>
</ul>
<p>
Branch pushed to git repo; I updated commit sha1. New commits:
</p>
<table class="wiki">
<tr><td><a class="ext-link" href="https://git.sagemath.org/sage.git/commit/?id=6a9f9531f02139f0d2d94c68dcd495902c8ac4e6"><span class="icon"></span>6a9f953</a></td><td><code>23257: Fixed documentation and syntax</code>
</td></tr></table>
TicketkcrismanMon, 26 Jun 2017 16:20:40 GMTcc changed
https://trac.sagemath.org/ticket/23257#comment:11
https://trac.sagemath.org/ticket/23257#comment:11
<ul>
<li><strong>cc</strong>
<em>kcrisman</em> added
</li>
</ul>
TicketkcrismanMon, 26 Jun 2017 16:33:20 GMT
https://trac.sagemath.org/ticket/23257#comment:12
https://trac.sagemath.org/ticket/23257#comment:12
<p>
If you are doing this sort of thing, maybe eventually it will supersede e.g. <a class="closed ticket" href="https://trac.sagemath.org/ticket/8423" title="enhancement: Add code to plot Julia sets (closed: fixed)">#8423</a>, <a class="new ticket" href="https://trac.sagemath.org/ticket/1004" title="enhancement: basic discrete dynamical systems functions (new)">#1004</a>, <a class="new ticket" href="https://trac.sagemath.org/ticket/11837" title="enhancement: Make Newton basin plotting fun and easy (new)">#11837</a> ? See also <a class="ext-link" href="https://groups.google.com/forum/#!msg/sage-devel/9l519086XCA/pCqtlF9GGkQJ"><span class="icon"></span>this old sage-devel thread</a>.
</p>
TicketkcrismanMon, 26 Jun 2017 16:52:48 GMT
https://trac.sagemath.org/ticket/23257#comment:13
https://trac.sagemath.org/ticket/23257#comment:13
<p>
Various comments I hope are useful:
</p>
<ul><li>This branch doesn't apply to latest develop, apparently?
</li><li>Separately, it would be useful to know whether the interactive functionality works anywhere than in the SageNB notebook. Jupyter? SMC sagews? Sage Cell Server?
</li><li>Also, one could probably use the newish Sphinx plot directive thingamabob to put a few in the documentation...
</li><li>Does this plot Julia sets, as the file seems to indicate? What about plot for anything other than the square+add map? (E.g. z<sup>3+c.)
</sup></li><li>How long does testing these take? You may need to mark some tests <code># long time</code>.
</li></ul><p>
I understand some of this may be answered by your work later in the GSOC summer but wanted to try to get that all out there. Good luck - as you can tell from some of my references in <a class="ticket" href="https://trac.sagemath.org/ticket/23257#comment:12" title="Comment 12">comment:12</a>, this has been missing in Sage for a LONG time.
</p>
TicketgitWed, 28 Jun 2017 18:51:55 GMTcommit changed
https://trac.sagemath.org/ticket/23257#comment:14
https://trac.sagemath.org/ticket/23257#comment:14
<ul>
<li><strong>commit</strong>
changed from <em>6a9f9531f02139f0d2d94c68dcd495902c8ac4e6</em> to <em>1afa33239d14c19261da3f710a7849532019f16b</em>
</li>
</ul>
<p>
Branch pushed to git repo; I updated commit sha1. New commits:
</p>
<table class="wiki">
<tr><td><a class="ext-link" href="https://git.sagemath.org/sage.git/commit/?id=f74fac884bad75b1b517c0aa610ad53a1ff4542f"><span class="icon"></span>f74fac8</a></td><td><code>Merge branch 'master' into 23257</code>
</td></tr><tr><td><a class="ext-link" href="https://git.sagemath.org/sage.git/commit/?id=e1a3791d6c55db45c201091e1f6b50525cf8a794"><span class="icon"></span>e1a3791</a></td><td><code>23257: Changed to lazy_import in complex_dynamics/all.py</code>
</td></tr><tr><td><a class="ext-link" href="https://git.sagemath.org/sage.git/commit/?id=1afa33239d14c19261da3f710a7849532019f16b"><span class="icon"></span>1afa332</a></td><td><code>23257: Fixed merge conflict and doctests</code>
</td></tr></table>
TicketbbarrosWed, 28 Jun 2017 18:58:03 GMT
https://trac.sagemath.org/ticket/23257#comment:15
https://trac.sagemath.org/ticket/23257#comment:15
<p>
Thanks for the feedback! The plotting of the Julia set is what we plan to work on next after finishing up everything with the Mandelbrot set so we thought we should name the functions accordingly. I have not tried to use the interact functionality in anywhere besides the Sage notebook so I will be sure to try those out and make a note of it in the documentation. I am also not familiar with Sphinx so I will have to take a look at that. As far as a more general version of the function, we plan to get to that after we tackle Julia sets.
</p>
<p>
Thanks again,
</p>
<p>
Ben Barros
</p>
<p>
Replying to <a class="ticket" href="https://trac.sagemath.org/ticket/23257#comment:13" title="Comment 13">kcrisman</a>:
</p>
<blockquote class="citation">
<p>
Various comments I hope are useful:
</p>
<ul><li>This branch doesn't apply to latest develop, apparently?
</li><li>Separately, it would be useful to know whether the interactive functionality works anywhere than in the SageNB notebook. Jupyter? SMC sagews? Sage Cell Server?
</li><li>Also, one could probably use the newish Sphinx plot directive thingamabob to put a few in the documentation...
</li><li>Does this plot Julia sets, as the file seems to indicate? What about plot for anything other than the square+add map? (E.g. z<sup>3+c.)
</sup></li><li>How long does testing these take? You may need to mark some tests <code># long time</code>.
</li></ul><p>
I understand some of this may be answered by your work later in the GSOC summer but wanted to try to get that all out there. Good luck - as you can tell from some of my references in <a class="ticket" href="https://trac.sagemath.org/ticket/23257#comment:12" title="Comment 12">comment:12</a>, this has been missing in Sage for a LONG time.
</p>
</blockquote>
TicketbbarrosWed, 28 Jun 2017 19:11:35 GMT
https://trac.sagemath.org/ticket/23257#comment:16
https://trac.sagemath.org/ticket/23257#comment:16
<p>
I added a TESTS block in the documentation of mandelbrot_plot and changed all of the examples to have the flag # not tested. I don't quite like the look of this in the documentation but it was the only I way I could think of for now. Here is an example of what I am talking about:
</p>
<div class="wiki-code"><div class="code"><pre>sage<span class="p">:</span> mandelbrot_plot<span class="p">()</span> <span class="c"># not tested</span>
sage<span class="p">:</span> mandelbrot_plot<span class="p">(</span>pixel_count<span class="o">=</span><span class="mi">1000</span><span class="p">)</span> <span class="c"># not tested</span>
sage<span class="p">:</span> mandelbrot_plot<span class="p">(</span>base_color<span class="o">=</span><span class="p">[</span><span class="mi">70</span><span class="p">,</span> <span class="mi">40</span><span class="p">,</span> <span class="mi">240</span><span class="p">])</span> <span class="c"># not tested</span>
sage<span class="p">:</span> mandelbrot_plot<span class="p">(</span>x_center<span class="o">=-</span><span class="mf">0.75</span><span class="p">,</span> y_center<span class="o">=</span><span class="mf">0.25</span><span class="p">,</span> image_width<span class="o">=</span><span class="mi">1</span><span class="o">/</span><span class="mi">2</span><span class="p">,</span> number_of_colors<span class="o">=</span><span class="mi">75</span><span class="p">)</span> <span class="c"># not tested</span>
<span class="s">"To use the function outside of the notebook, you must set interact to False"</span>
sage<span class="p">:</span> mandelbrot_plot<span class="p">(</span>interact<span class="o">=</span><span class="bp">False</span><span class="p">)</span> <span class="c"># not tested</span>
Launched png viewer <span class="k">for</span> <span class="mi">500</span>x500px <span class="mi">24</span><span class="o">-</span>bit RGB image
sage<span class="p">:</span> mandelbrot_plot<span class="p">(</span>interact<span class="o">=</span><span class="bp">False</span><span class="p">,</span> x_center<span class="o">=-</span><span class="mf">1.11</span><span class="p">,</span> y_center<span class="o">=</span><span class="mf">0.2283</span><span class="p">,</span> image_width<span class="o">=</span><span class="mi">1</span><span class="o">/</span><span class="mi">128</span><span class="p">,</span> <span class="c"># not tested</span>
<span class="o">....</span><span class="p">:</span> max_iteration<span class="o">=</span><span class="mi">2000</span><span class="p">,</span> number_of_colors<span class="o">=</span><span class="mi">500</span><span class="p">,</span> base_color<span class="o">=</span><span class="p">[</span><span class="mi">40</span><span class="p">,</span> <span class="mi">100</span><span class="p">,</span> <span class="mi">100</span><span class="p">])</span>
Launched png viewer <span class="k">for</span> <span class="mi">500</span>x500px <span class="mi">24</span><span class="o">-</span>bit RGB image
</pre></div></div>
TicketbbarrosWed, 28 Jun 2017 19:12:25 GMTstatus changed
https://trac.sagemath.org/ticket/23257#comment:17
https://trac.sagemath.org/ticket/23257#comment:17
<ul>
<li><strong>status</strong>
changed from <em>needs_work</em> to <em>needs_review</em>
</li>
</ul>
TicketbhutzWed, 28 Jun 2017 20:24:21 GMT
https://trac.sagemath.org/ticket/23257#comment:18
https://trac.sagemath.org/ticket/23257#comment:18
<p>
An easy fix: lighter not darker for more iterations
</p>
<p>
I understand preventing the huge html ones from running in the EXAMPLES so that the user isn't bombarded. It is good that they are there so the user can see how to call the function with various parameters. But why are the non-interact ones blocked as well? It seems that you just add them later in TESTS section. I'd just put them in the example section and let them run.
</p>
<p>
Do you still need to add the 'Extension' for importing the .pyx? Since those are now private functions, I didn't think you needed that anymore.
</p>
<p>
I can't say I like the interact html tests. Maybe post a question to sage-devel about how to test an interact with a doctest, or even if you should be trying to.
</p>
TicketkcrismanWed, 28 Jun 2017 20:40:47 GMT
https://trac.sagemath.org/ticket/23257#comment:19
https://trac.sagemath.org/ticket/23257#comment:19
<blockquote class="citation">
<p>
I can't say I like the interact html tests. Maybe post a question to sage-devel about how to test an interact with a doctest, or even if you should be trying to.
</p>
</blockquote>
<p>
Don't bother trying to actually test them. BUT you should definitely still include this as documentation (not <code>TESTS</code>) so that people know what the heck to do; the point is to get it used.
</p>
<p>
I highly recommend creating a <a class="missing wiki">CoCalc?</a> account and trying this with the Jupyter (or even locally) and .sagews format. You'd need some kind of internet access or special permission from William to try out your branch, but that should be doable. I don't see any reason it shouldn't work though if you are using the same widgets.
</p>
TicketjdemeyerWed, 28 Jun 2017 20:42:46 GMTstatus changed
https://trac.sagemath.org/ticket/23257#comment:20
https://trac.sagemath.org/ticket/23257#comment:20
<ul>
<li><strong>status</strong>
changed from <em>needs_review</em> to <em>needs_work</em>
</li>
</ul>
<ol><li>For example about how to include and test interacts, see <code>src/sage/interacts/library.py</code>.
</li></ol><ol start="2"><li>There is a specific widget for colors, use that instead of an input box.
</li></ol><ol start="3"><li>Don't <code>show()</code> the plot, but return the plot.
</li></ol><ol start="4"><li>In the Cython code: why use <code>float</code> which has limited precision? I would guess that things get more interesting with <code>double</code> precision, especially for deeper zooms. Second, it's less important, but I would use <code>long</code> instead of <code>int</code>. It would be unlikely that somebody would use more than 2<sup>31</sup> pixels or iterations, but at least we should not a priori exclude it either.
</li></ol><ol start="5"><li>In the Cython code: use <code>sig_check</code> to make the code interruptible, see <a class="ext-link" href="http://cysignals.readthedocs.io/en/latest/interrupt.html"><span class="icon"></span>http://cysignals.readthedocs.io/en/latest/interrupt.html</a>
</li></ol><ol start="6"><li>In the Cython code: better add typing for every variable like <code>x_step</code>.
</li></ol><ol start="7"><li>To be compatible with Python 3: add <code>from __future__ import absolute_import, division</code> at the top of your files and consider whether you want floor division (use <code>//</code> in that case) or true division.
</li></ol>
TicketjdemeyerWed, 28 Jun 2017 20:51:49 GMT
https://trac.sagemath.org/ticket/23257#comment:21
https://trac.sagemath.org/ticket/23257#comment:21
<ol start="8"><li>Obviously, <em>do</em> test <code>mandelbrot_plot()</code> (I guess the reason that you don't is number 3 from my last comment).
</li></ol><ol start="9"><li>The formatting of <code>TESTS</code> is wrong, it should be <code>TESTS::</code> with indentation.
</li></ol>
TicketkcrismanWed, 28 Jun 2017 20:55:45 GMT
https://trac.sagemath.org/ticket/23257#comment:22
https://trac.sagemath.org/ticket/23257#comment:22
<p>
Okay, this is pretty impressive. But still some stuff for sure needs to be done. Jeroen has some very good ideas for Cython.
</p>
<p>
I'm not sure whether the default should be interactive or not. Usually one would make the static one the default.
</p>
<p>
Second, it's not clear to me that the only way one wants to interact with this is via typing in things. Sliders make much more sense for at least generic zooming exploration. I don't know whether this should be an option or show people how to see them ...
</p>
TicketjdemeyerWed, 28 Jun 2017 20:58:20 GMT
https://trac.sagemath.org/ticket/23257#comment:23
https://trac.sagemath.org/ticket/23257#comment:23
<p>
I just saw that there is an existing Mandelbrot interact implementation <code>interacts.fractals.mandelbrot()</code> in <code>src/sage/interacts/library.py</code>. You should at least try that one and maybe see if you can reuse something or replace that one with your version...
</p>
TicketkcrismanWed, 28 Jun 2017 21:03:02 GMT
https://trac.sagemath.org/ticket/23257#comment:24
https://trac.sagemath.org/ticket/23257#comment:24
<p>
Ha, I totally forgot about that one! Indeed,
</p>
<pre class="wiki">from .library import mandelbrot, julia, cellular_automaton
</pre><p>
Hopefully the work you did here is good background for something far more general ...
</p>
TicketbbarrosThu, 29 Jun 2017 18:32:43 GMT
https://trac.sagemath.org/ticket/23257#comment:25
https://trac.sagemath.org/ticket/23257#comment:25
<p>
The plan is to get the Mandelbrot set plotted and then move on to more general functionality such as plotting external rays on the Mandelbrot set, plotting of Julia sets, and eventually plotting the Mandelbrot set for more general functions.
</p>
TicketgitFri, 30 Jun 2017 18:10:33 GMTcommit changed
https://trac.sagemath.org/ticket/23257#comment:26
https://trac.sagemath.org/ticket/23257#comment:26
<ul>
<li><strong>commit</strong>
changed from <em>1afa33239d14c19261da3f710a7849532019f16b</em> to <em>9b6738b06bcfa199a4f7148a3cde5218fdb5f012</em>
</li>
</ul>
<p>
Branch pushed to git repo; I updated commit sha1. New commits:
</p>
<table class="wiki">
<tr><td><a class="ext-link" href="https://git.sagemath.org/sage.git/commit/?id=9b6738b06bcfa199a4f7148a3cde5218fdb5f012"><span class="icon"></span>9b6738b</a></td><td><code>23257: Cython, Python 3 improvements, Color widget added</code>
</td></tr></table>
TicketbbarrosFri, 30 Jun 2017 18:24:08 GMT
https://trac.sagemath.org/ticket/23257#comment:27
https://trac.sagemath.org/ticket/23257#comment:27
<p>
I cleaned up the documentation, added sig_check() to make the function interruptable, Python 3 division, changed the floats to doubles, and ints to longs. I have been playing around with sliders for a while and it isn't very easy to get the precision required when zooming in. They may be convenient for navigating around the image but they are usually too sensitive when you zoom in far enough. I plan to replace the code in the interacts library eventually. However, the function there is slightly more general than mine right now (it plots the set for different exponents of z) so I will leave it until I can replace it with a more general version.
</p>
TicketbbarrosFri, 30 Jun 2017 18:24:23 GMTstatus changed
https://trac.sagemath.org/ticket/23257#comment:28
https://trac.sagemath.org/ticket/23257#comment:28
<ul>
<li><strong>status</strong>
changed from <em>needs_work</em> to <em>needs_review</em>
</li>
</ul>
TicketkcrismanFri, 30 Jun 2017 20:41:26 GMT
https://trac.sagemath.org/ticket/23257#comment:29
https://trac.sagemath.org/ticket/23257#comment:29
<blockquote class="citation">
<p>
I have been playing around with sliders for a while and it isn't very easy to get the precision required when zooming in. They may be convenient for navigating around the image but they are usually too sensitive when you zoom in far enough.
</p>
</blockquote>
<p>
Oh, totally. However, it's also very hard to navigate using just the typed-in numbers. Maybe there can be some combination of that ... I wonder. Anyway, something to think about.
</p>
<blockquote class="citation">
<p>
I plan to replace the code in the interacts library eventually.
</p>
</blockquote>
<p>
I assume yours ends up being faster and/or more accurate? That will be welcome.
</p>
TicketvdelecroixFri, 30 Jun 2017 21:52:03 GMT
https://trac.sagemath.org/ticket/23257#comment:30
https://trac.sagemath.org/ticket/23257#comment:30
<p>
Why is it called <code>fast_mandel_plot</code> and not <code>fast_mandelbrot_plot</code>?
</p>
TicketgitFri, 30 Jun 2017 22:20:42 GMTcommit changed
https://trac.sagemath.org/ticket/23257#comment:31
https://trac.sagemath.org/ticket/23257#comment:31
<ul>
<li><strong>commit</strong>
changed from <em>9b6738b06bcfa199a4f7148a3cde5218fdb5f012</em> to <em>a1d02e4c35099cfe7bc344fd8647b38b526eacbb</em>
</li>
</ul>
<p>
Branch pushed to git repo; I updated commit sha1. New commits:
</p>
<table class="wiki">
<tr><td><a class="ext-link" href="https://git.sagemath.org/sage.git/commit/?id=a1d02e4c35099cfe7bc344fd8647b38b526eacbb"><span class="icon"></span>a1d02e4</a></td><td><code>23257: Changed fast_mandel_plot to fast_mandelbrot_plot</code>
</td></tr></table>
TicketbbarrosFri, 30 Jun 2017 22:21:24 GMT
https://trac.sagemath.org/ticket/23257#comment:32
https://trac.sagemath.org/ticket/23257#comment:32
<p>
Replying to <a class="ticket" href="https://trac.sagemath.org/ticket/23257#comment:30" title="Comment 30">vdelecroix</a>:
</p>
<blockquote class="citation">
<p>
Why is it called <code>fast_mandel_plot</code> and not <code>fast_mandelbrot_plot</code>?
</p>
</blockquote>
<p>
Good question. I never really thought about that. I could change that pretty easily though.
</p>
<hr />
<p>
New commits:
</p>
<table class="wiki">
<tr><td><a class="ext-link" href="https://git.sagemath.org/sage.git/commit?id=a1d02e4c35099cfe7bc344fd8647b38b526eacbb"><span class="icon"></span>a1d02e4</a></td><td><code>23257: Changed fast_mandel_plot to fast_mandelbrot_plot</code>
</td></tr></table>
TicketbhutzSun, 02 Jul 2017 13:47:54 GMTstatus changed
https://trac.sagemath.org/ticket/23257#comment:33
https://trac.sagemath.org/ticket/23257#comment:33
<ul>
<li><strong>status</strong>
changed from <em>needs_review</em> to <em>needs_work</em>
</li>
</ul>
<p>
This is looking good, I just have a couple minor nitpicks.
</p>
<ul><li>in the INPUT
<ul><li>you have f(z) in max_iteration instead of Q_c(z) (both files)
</li><li>interact to false is not just for outside the notebook(in the .py file)
</li></ul></li></ul><ul><li>I thought you were going to change the default for interact to False
</li></ul><ul><li>line 78 of .pyx : initialize misspelled
</li></ul><ul><li>It took me a little bit to figure out why your y_step uses -y_center. Then I realized that it isn't really the y_step, that is scale_factor. Rather x_step, y_step represent the upper left hand corner of the image. And scale_factor really is the step_size. Then you are using the x-axis symmetry of the image. Any reason, you are not just using the correct y coordinate? Why don't you just use
<pre class="wiki">y_step = y_center + image_width/2
y_coor = y_step - col*scale_factor
</pre><ul><li>I also suggest renaming those variables to match their purpose and making a comment that you are starting at the upper left hand corner of the image.
</li></ul></li></ul><ul><li>line 102: sig_check not needed (you already check in the inside loop)
</li></ul>
TicketgitMon, 03 Jul 2017 17:42:17 GMTcommit changed
https://trac.sagemath.org/ticket/23257#comment:34
https://trac.sagemath.org/ticket/23257#comment:34
<ul>
<li><strong>commit</strong>
changed from <em>a1d02e4c35099cfe7bc344fd8647b38b526eacbb</em> to <em>8aae69cc30ad0e566e0e1fe6f7646822b91df50c</em>
</li>
</ul>
<p>
Branch pushed to git repo; I updated commit sha1. New commits:
</p>
<table class="wiki">
<tr><td><a class="ext-link" href="https://git.sagemath.org/sage.git/commit/?id=8aae69cc30ad0e566e0e1fe6f7646822b91df50c"><span class="icon"></span>8aae69c</a></td><td><code>23257: Changed default for interact to False</code>
</td></tr></table>
TicketbbarrosMon, 03 Jul 2017 17:45:17 GMTstatus changed
https://trac.sagemath.org/ticket/23257#comment:35
https://trac.sagemath.org/ticket/23257#comment:35
<ul>
<li><strong>status</strong>
changed from <em>needs_work</em> to <em>needs_review</em>
</li>
</ul>
<p>
I changed the default for the interact to False and consequently changed the examples a little bit. I also renamed and cleaned up the variables dealing with the coordinates. Please let me know if there's anything else that catches your attention.
</p>
TicketbhutzWed, 05 Jul 2017 15:03:17 GMTstatus changed
https://trac.sagemath.org/ticket/23257#comment:36
https://trac.sagemath.org/ticket/23257#comment:36
<ul>
<li><strong>status</strong>
changed from <em>needs_review</em> to <em>needs_work</em>
</li>
</ul>
<p>
Went to build the docs from scratch and there is an error:
</p>
<pre class="wiki">[dochtml] [dynamics ] /home/ben/sage/sage-test/src/doc/en/reference/dynamics/complex_dynamics.rst:: WARNING: document isn't included in any toctree
[dochtml] Error building the documentation.
</pre><p>
While we're renaming variables. Aren't your 'row' and 'col' variable as reversed.
</p>
<p>
Everything else looks fine
</p>
TicketkcrismanWed, 05 Jul 2017 15:26:50 GMT
https://trac.sagemath.org/ticket/23257#comment:37
https://trac.sagemath.org/ticket/23257#comment:37
<p>
To be fair, that could be an unrelated thing due to switching between branches; try <code>make doc-clean</code> and then make the doc again? See <a class="closed ticket" href="https://trac.sagemath.org/ticket/22588" title="defect: Let "make doc" really always work (closed: fixed)">#22588</a>.
</p>
TicketbhutzWed, 05 Jul 2017 16:37:20 GMT
https://trac.sagemath.org/ticket/23257#comment:38
https://trac.sagemath.org/ticket/23257#comment:38
<p>
It was a clean doc build.
</p>
TicketgitWed, 05 Jul 2017 18:17:03 GMTcommit changed
https://trac.sagemath.org/ticket/23257#comment:39
https://trac.sagemath.org/ticket/23257#comment:39
<ul>
<li><strong>commit</strong>
changed from <em>8aae69cc30ad0e566e0e1fe6f7646822b91df50c</em> to <em>f52fb3fc9b32f6c24bdf3f308740603933d44600</em>
</li>
</ul>
<p>
Branch pushed to git repo; I updated commit sha1. New commits:
</p>
<table class="wiki">
<tr><td><a class="ext-link" href="https://git.sagemath.org/sage.git/commit/?id=f52fb3fc9b32f6c24bdf3f308740603933d44600"><span class="icon"></span>f52fb3f</a></td><td><code>23257: Added complex_dynamics to dynamics/index.rst</code>
</td></tr></table>
TicketbbarrosWed, 05 Jul 2017 18:17:55 GMTstatus changed
https://trac.sagemath.org/ticket/23257#comment:40
https://trac.sagemath.org/ticket/23257#comment:40
<ul>
<li><strong>status</strong>
changed from <em>needs_work</em> to <em>needs_review</em>
</li>
</ul>
TicketbhutzWed, 05 Jul 2017 18:34:32 GMTstatus, milestone changed
https://trac.sagemath.org/ticket/23257#comment:41
https://trac.sagemath.org/ticket/23257#comment:41
<ul>
<li><strong>status</strong>
changed from <em>needs_review</em> to <em>positive_review</em>
</li>
<li><strong>milestone</strong>
changed from <em>sage-8.0</em> to <em>sage-8.1</em>
</li>
</ul>
<p>
Since 8.0.rc0 I out, I assume this gets pushed to 8.1 now.
</p>
TicketbhutzFri, 21 Jul 2017 19:38:07 GMTcomponent changed
https://trac.sagemath.org/ticket/23257#comment:42
https://trac.sagemath.org/ticket/23257#comment:42
<ul>
<li><strong>component</strong>
changed from <em>fractals</em> to <em>dynamics</em>
</li>
</ul>
TicketvbraunThu, 03 Aug 2017 22:11:26 GMTstatus, branch changed; resolution set
https://trac.sagemath.org/ticket/23257#comment:43
https://trac.sagemath.org/ticket/23257#comment:43
<ul>
<li><strong>status</strong>
changed from <em>positive_review</em> to <em>closed</em>
</li>
<li><strong>resolution</strong>
set to <em>fixed</em>
</li>
<li><strong>branch</strong>
changed from <em>u/bbarros/23257</em> to <em>f52fb3fc9b32f6c24bdf3f308740603933d44600</em>
</li>
</ul>
Ticket