Jupyter Notebook

I would like to start a conversation in this group about the use of Jupyter Notebook for education. How many of you use them? Do you think they are a better teaching tool than traditional notes/codes? Do you use them with Python only or with other languages as well, such as Julia?

I think it would be interesting to ask CIG to create repository and maintain it for teaching material for all undergraduate and early graduate instructor in geophysics. How many of you would share these resources? How would you envisage the organization of such a general repository, how could we select the material in a practical manner, and so on?

I was discussing something similar with @jbnaliboff and @ljhwang last week. I think this probably warrants a bigger group discussion about how such a repository would operate, and what people hope to get out of it. I have some bandwidth right now, and I’d really like to get the gears turning on making something like this happen.

I’ll follow up later this week or early next, but I think it would be useful to get a group together via zoom some time this term to discuss how we might proceed with something like this, and what CIG’s role should be in curating educational content in general.

One reason that I do not currently use them is that I find parallelism cumbersome in Jupyter. Perhaps this has improved since I last tried it.

Matt

I agree, parallel computing is still done better with other tools. There is this option to use MPI for Python by starting a cell with %%px , but I agree it is just for prototyping. It might still be good for teaching, though.

When do you teach parallel computing in your classes to non computer science students, what do you normally use?

That would be great. I am totally for it. We should address the entire CIG community and ask for their priorities.

As Matt was pointing out, Jupyter is great for starting, for students who know little about computing, but we need a plan also for more advanced courses, who for example want to have some parallel computing component in their syllabus.

I use C and MPI. I know it is old school, but I still find the C syntax very clear, and the MPI API well-designed. I agree that looking for type errors or memory bugs is a pain, but I try to mitigate that with lots of compiler warnings turned on and using tools like valgrind.

Thanks for restarting this discussion. I am working on a website overhaul which will allows us to add support for running Jupyter Notebooks. I have a placeholder in for Jupyter but I would be interested in hearing people’s ideas on what this will look so it can be properly integrated.

We should also look at JupyterLab as it has terminal support.

@knepley Jupyter supports a number of kernels including C but not MPI:
https://github.com/jupyter/jupyter/wiki/Jupyter-kernels

@gabrielemorra You asked how a repository might be organized. Maybe we start with potential uses:

  • Undergraduate education
  • Graduate education
  • Software Tutorials
  • Short courses
  • Public outreach

There would be crossover between these categories. If we tagged modules correctly into a general software repository, then it would be possible to create custom courses. As one vision.

@ljhwang, I would put undergraduate and graduate education together, as students arrive with very different levels of programming skills as senior and graduate level of study, particularly in geosciences, but not only.

What about calling the entire community of CIG to tell us which Jupyter resources already exist and then organize the repository around what people offer.

While CIG gets ready to run the Notebooks on its own server, we could place them in a repository linked to a google cloud account, so it would be possible to run them automatically on google colab. This is what I normally do with my students.

1 Like

There are many ways now to run MPI codes on Jupyter on the cloud. For example on google colab: https://stackoverflow.com/questions/57745296/how-can-i-run-mpi4py-code-on-google-colab

I am sure the same can be done on Amazon Cloud.

@gabrielemorra - Thanks for initiating this discussion! I will be developing both introductory and advanced python-based geoscience computing courses over the next year, and would be very interested to participate in any discussions going forward.

I know @mibillen and @maxrudolph have also developed quite a bit of python-based curriculum, and would likely have quite a bit to add to these discussions as well.

Hi all,

A few updates.

First, I have started using Google Colab for hosting and running python notebooks for an Earth science computing class. It is extremely straightforward to use and interfaces seamlessly with google drive. I highly recommend as a platform-independent educational computing environment.

Second, I would like to bring up a notebook-related idea that was recently discussed by a number of colleagues. Given man of us are interested in developing (or have developed) python-based teaching material for various levels of the Earth sciences, what would everyone think about combining efforts and having a “Hackathon” to create a database of teaching material?

This database could be in the form of a “Jupyter book”, which descriptive text + figures, interactive code examples, and links to different notebooks with more detail and exercises.

Thoughts? Interest?

Cheers,
John

At least working with interpreted languages like Python or Julia, I think notebooks are an ideal teaching tool. It’s the classic thing about “show don’t tell”. Notebooks let you mix explanation with precise demonstrations of how to do the thing you’re talking about. It’s especially nice when you can load up a notebook in something like Google Colab or Binder so that there’s zero setup required for students.

One comment here is that it’s easy to include C or C++ or Cython <–> Python extensions directly in notebook cells. One way of doing this is with the “%%cython” cell magic. This makes it fairly easy to mix Python and snippets of C++ together in a notebook. This partially solves the parallelism issues discussed above because you can, for example, do your fun OpenMP stuff in C++.

Since the last message here, the popularity of jupyterbooks has exploded. I’ve been writing a series of tutorials on earthquake cycle simulation particularly with boundary integral methods. Very much in draft form: Integral equation tutorials — Integral equation tutorials

Ben, this is really interesting. I agree that cig should have a big space for Jupyter books, which hybrid coding and science so well.

Great timing on this thread!
We are heading to a soft roll out of our new website at the end of the month. The next phase will be to implement the “tool” functionality that will allow us to host Jupyter notebooks. We are very interested in contributions and test applications. Is there anyone willing to form a small working group in brainstorming over scope and direction?