-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Example nbinteract integration for Acoustics #128
Conversation
@CalebS97, @SamLau95 : Thanks for working on this! We've just gotten back to this project after a hiatus, and are in the process of updating various things. @ketch is currently taking a pass on all notebooks, mostly with regard to content and some pdf issues, but soon we'll get back to thinking about the html rendering, and then it will be good to see if we can make it all work with nbinteract. |
@CalebS97 @SamLau95 I tried it out with your modified version of I've also been looking at the output for the
suggesting that the Python kernel had not run the other cells in the notebook. Also, wherever the 'Show widgets' button shows up, I see two of them. I'd like to work with you on fixing these issues; let me know how I can help. |
Thanks for taking a closer look @ketch ! I've made three new nbinteract issues (linked above) based on what you've reported and we're working on them this week. We'll focus our efforts on getting the Since trying (and failing) to get nbinteract to work on this book has been really helpful in surfacing current issues, @CalebS97 and I are making it a priority to go as far as we can in creating an interactive HTML version of the Riemann book. In the short term, we'll take on each issue as it arises; all of the issues reported so far will likely arise for other people as well, so this isn't just a one-off effort for us. We'll report back on this thread as we fix bugs. In the longer term, we're looking into ways of extending nbinteract's plotting methods to allow us to recreate your interactive plots without the flickering that occurs because of matplotlib-based plotting. Our hope is that the resulting API will be both easier to use than manually hooking up widgets and produce smoother interactions for viewers. Let me know if you have any comments / questions! |
@SamLau95 This is great! We're happy to be providing good test cases for you. We think that notebooks + widgets is a promising new paradigm for education and hoping that our book will help move it forward, and I think nbinteract can make the whole framework dramatically better. |
Hey @ketch , we made some fixes to nbinteract and some changes to your script (827cb02). We were then able to convert all notebooks without error except these: For those notebooks, I run into errors importing I've pushed all the resulting successfully converted notebooks onto this branch. You can view them at https://calebs97.github.io/riemann_book/build_html/Index.html We've fixed the issue with widgets not generating when using Here are the remaining issues off the top of my head:
|
@SamLau95 It's looking good. I can answer your first question: as explained at https://github.com/clawpack/riemann_book/wiki/Installation, you need the "bleeding edge" development version of clawpack.riemann. That page also has instructions on how to get it. We'll make a new Clawpack release when the book is ready, but for now those additional steps are necessary. I agree that the interacts are not as snappy as they ought to be. The amount of actual "computation" being done is very small though -- at least, for most of them. Most of the delay is time spent in matplotlib plotting calls. I'm not sure how to speed that up. Perhaps we could cache the images themselves, but we'd need to do that in a vectorized format (rasterizing them makes the line plots too difficult to read, in my opinion). For interacts with a single parameter, the JSAnimation library does exactly this -- cache all the results. So it might be nice to stick with that for such interacts, and use the nbinteract approach only for interacts with more than one parameter. |
@ketch Thanks for the tip; with your advice I was able to build all the notebooks and push them to https://calebs97.github.io/riemann_book/build_html/Index.html . It looks like there are still a few remaining TODO items on our end. In order of priority:
As a heads up, I've been pretty busy putting together my MS thesis and will be prioritizing that for the near month or so. Development on nbinteract will likely be my main focus starting at the end of May. Do you have a rough idea of when you'd ideally have an interactive HTML version of the book by? |
Related issues: #123, SamLau95/nbinteract#45
Our original goal was to reproduce your html book using nbinteract to enable widgets. However, we were only successful in converting Acoustics.html. link
These were our steps:
make_html_on_master.py
Moving forward:
We think a good way to work together is for you to tell us what you think are particularly useful pages for interaction and we can work with you to get those pages up and running. Hopefully in the process, we'll fix the rest of the bugs that will allow the rest of your book to be converted using nbinteract.
cc @SamLau95