Opened 2 years ago
Closed 21 months ago
#24994 closed enhancement (fixed)
convert mandelbrot/julia interact to jupyter notebook
Reported by:  chapoton  Owned by:  

Priority:  major  Milestone:  sage8.3 
Component:  notebook  Keywords:  
Cc:  bbarros, bhutz, atowsley, kcrisman, embray, jdemeyer, jmantysalo  Merged in:  
Authors:  Frédéric Chapoton, Jeroen Demeyer  Reviewers:  Frédéric Chapoton, Jeroen Demeyer 
Report Upstream:  N/A  Work issues:  
Branch:  4de168d (Commits)  Commit:  4de168d769d72100f0650192e3370a4080de380b 
Dependencies:  #25373  Stopgaps: 
Description
as another step to python3
Change History (42)
comment:1 Changed 2 years ago by
 Branch set to public/24994
 Commit set to a9e184dddde2c132e3754dc77ff4e07a875eede6
comment:2 Changed 2 years ago by
 Commit changed from a9e184dddde2c132e3754dc77ff4e07a875eede6 to 52ce4a55d0b43cf497a347bea977911d494caee7
Branch pushed to git repo; I updated commit sha1. New commits:
52ce4a5  second pass at interactive mandelbrot/julia in ipython notebook

comment:3 Changed 2 years ago by
 Commit changed from 52ce4a55d0b43cf497a347bea977911d494caee7 to c65a01c21c59d309abed48271439bbd18b675c91
Branch pushed to git repo; I updated commit sha1. New commits:
c65a01c  fixing colors and other details

comment:4 Changed 2 years ago by
 Commit changed from c65a01c21c59d309abed48271439bbd18b675c91 to 7cbf77bce84be661537eaf9e48d51d057a8b6dc0
Branch pushed to git repo; I updated commit sha1. New commits:
7cbf77b  trying to fix doctests..

comment:5 Changed 2 years ago by
 Status changed from new to needs_review
ok, working now. Except 3 failing doctests that I just fail to write using ellipsis !
comment:6 Changed 2 years ago by
 Cc bbarros bhutz atowsley kcrisman added
comment:7 Changed 2 years ago by
 Commit changed from 7cbf77bce84be661537eaf9e48d51d057a8b6dc0 to 4467110694aee29adafa5f136ff026ee0d050d98
Branch pushed to git repo; I updated commit sha1. New commits:
4467110  pep8 and pyflakes cleanup

comment:8 Changed 2 years ago by
 Commit changed from 4467110694aee29adafa5f136ff026ee0d050d98 to 588ac04e725652d7dc4f6fe7dd86dcc8e3fb1fd6
Branch pushed to git repo; I updated commit sha1. New commits:
588ac04  fixing doctests (ugly)

comment:9 Changed 2 years ago by
 Status changed from needs_review to needs_work
This is bad:
M = mandelbrot_interact ...adjust various attributes of M... return M
The problem is that you are changing and returning a unique global object. Instead of having
@interact.widget def mandelbrot_interact(...
it would be better to just define mandelbrot_interact
as an ordinary function and call interact.widget()
inside the mandelbrot_plot
function. That way, you end up with nonunique widgets.
Can you explain the <CSI2K>
appearing in the doctests? I feel uncomfortable accepting that without knowing where it comes from.
comment:10 Changed 2 years ago by
 Commit changed from 588ac04e725652d7dc4f6fe7dd86dcc8e3fb1fd6 to 8bdbb0dcaff0e35ff37d7132f9194c90560f1b80
Branch pushed to git repo; I updated commit sha1. New commits:
8bdbb0d  made the suggested changes

comment:12 Changed 2 years ago by
ping ?
comment:13 Changed 23 months ago by
*ping* ?
comment:14 Changed 23 months ago by
review, please ?
comment:15 Changed 23 months ago by
ping again
comment:16 Changed 23 months ago by
 Cc embray jdemeyer added
Could please someone have a look at the result here ? This seems to work well, and is a good step in getting rid of the dependencies to sagenb.
comment:17 Changed 22 months ago by
It looks good to me. I had just moved the imports from sagenb
inline, but this is obviously a more complete approach. I haven't tested it, but if you say it works it's good enough for me.
comment:18 Changed 22 months ago by
It seems not to be working anymore.. :(
comment:19 Changed 22 months ago by
Jeroen, any idea of what should be done, please ?
comment:20 Changed 22 months ago by
Here is the message I get (once disactivating the image):
Failed to display Jupyter Widget of type sage_interactive. If you're reading this message in the Jupyter Notebook or JupyterLab Notebook, it may mean that the widgets JavaScript is still loading. If this message persists, it likely means that the widgets JavaScript library is either not installed or not enabled. See the Jupyter Widgets Documentation for setup instructions. If you're reading this message in another frontend (for example, a static rendering on GitHub or NBViewer), it may mean that your frontend doesn't currently support widgets.
This is not specific to the widget built here. Simple basic widgets have the same issue. Could someone confirm this issue ?
import ipywidgets as widgets widgets.Checkbox()
comment:21 Changed 22 months ago by
 Cc jmantysalo added
comment:22 Changed 22 months ago by
I can see no problem with mandelbrot_plot(interact=True)
on sage notebook=ipython
; another thing is sage notebook=sagenb
which just says "Interactive function <function mandelbrot_interact . . ."
But the main idea of fractal does not work when there is no widget for infinite zooming.
comment:23 followup: ↓ 24 Changed 22 months ago by
If it works for you (in which version of sage ?), then one can probably set this to positive review. My install should be somehow broken.
Yes, this is a pity that there is no good clickablepicture widget. But the main aim here is to move towards python3 by geeting rid of all imports of sagenb.
comment:24 in reply to: ↑ 23 ; followup: ↓ 25 Changed 22 months ago by
Replying to chapoton:
If it works for you (in which version of sage ?), then one can probably set this to positive review. My install should be somehow broken.
I had 8.2rc4, and with git trac checkout...
of this ticket I got 8.2beta8. So should I try to merge this to newest beta/rc version?
Yes, this is a pity that there is no good clickablepicture widget. But the main aim here is to move towards python3 by geeting rid of all imports of sagenb.
OK.
comment:25 in reply to: ↑ 24 Changed 22 months ago by
Replying to jmantysalo:
So should I try to merge this to newest beta/rc version?
I did this. No changes, it wotks.
comment:26 Changed 22 months ago by
Thanks a lot. Feel free to set to positive, then.
comment:27 followup: ↓ 28 Changed 22 months ago by
Hmm... I don't know about those widgets. The code seems clear. Jeroen, have you checked this?
comment:28 in reply to: ↑ 27 Changed 22 months ago by
comment:29 Changed 22 months ago by
 Component changed from python3 to notebook
 Dependencies set to #25074
 Status changed from needs_review to needs_work
I'm not so happy that the input to mandelbrot_plot()
is now completely ignored when interact=True
is given. I'll try to work on this.
I will rebase on #25074. That's not strictly needed, but it's good to test against the newest version of ipywidgets.
comment:30 Changed 22 months ago by
 Commit changed from 8bdbb0dcaff0e35ff37d7132f9194c90560f1b80 to 4b925be17c667135e4de428f2b08ed81054a37ba
comment:31 Changed 22 months ago by
Is this still "needing work", Jeroen ?
This is the place where docbuild currently fails on the python3 patchbot. See
comment:32 Changed 22 months ago by
 Dependencies #25074 deleted
 Milestone changed from sage8.2 to sage8.3
comment:33 Changed 22 months ago by
This is working fine, the only issue is comment:29
comment:34 Changed 22 months ago by
 Commit changed from 4b925be17c667135e4de428f2b08ed81054a37ba to 8143016b1e0f07ef8baa899cd79434f426cec244
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
8143016  first tentative of conversion of mandelbrot interact to jupyter interact

comment:35 Changed 22 months ago by
OK, I'll work on this today.
comment:36 Changed 22 months ago by
 Dependencies set to #25373
comment:37 Changed 22 months ago by
 Commit changed from 8143016b1e0f07ef8baa899cd79434f426cec244 to e4523c40d839aeb3eaa6c775beb446c5961c164b
comment:38 Changed 22 months ago by
 Commit changed from e4523c40d839aeb3eaa6c775beb446c5961c164b to 56b571f3b501359e87481f047004d75826d60db7
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
56b571f  Improve Mandelbrot/Julia interact

comment:39 Changed 22 months ago by
 Commit changed from 56b571f3b501359e87481f047004d75826d60db7 to 4de168d769d72100f0650192e3370a4080de380b
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
4de168d  Improve Mandelbrot/Julia interact

comment:40 Changed 22 months ago by
 Status changed from needs_work to needs_review
comment:41 Changed 21 months ago by
 Reviewers set to Frédéric Chapoton, Jeroen Demeyer
 Status changed from needs_review to positive_review
I think I can reasonably set this to positive now.
comment:42 Changed 21 months ago by
 Branch changed from public/24994 to 4de168d769d72100f0650192e3370a4080de380b
 Resolution set to fixed
 Status changed from positive_review to closed
work in progress, not yet working as expected..
New commits:
first tentative of conversion of mandelbrot interact to jupyter interact