npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

moon-jupyterlab

v1.1.4

Published

Model Action Notebook

Downloads

14

Readme

MOON : MOnitoring Online Notebook

Requirements

  • JupyterLab >= 3.0

Install and use

Open a new terminal and run the following commands to create a new environment and install the MOON extension.

conda create -n your_name_env jupyterlab
conda activate your_name_env
jupyter labextension install moon-jupyterlab
jupyter lab

Uninstall

jupyter labextension uninstall moon-jupyterlab

Introduction

Jupyter Notebook and more recently JupyterLab are web applications for creating programming. JupyterLab is the new version of the classic Jupyter Notebook. It consists of code and markdown cells which contain information in a structured way. They are used especially by data scientists and teachers to share literate programming documents in many fields such as computer science, physics, mathematics or information and communication sciences.

A notebook is often a complex and interactive document that tells a story to its reader and this story is not necessarily linear. In this case the reader is faced with a document that potentially has a large number of possible execution paths. (If n is the number of cells to execute, so the notebook has n! possible execution paths). Among the set of possible execution paths, only a very very reduced subset interests our writer and consequently our reader. If we say that our writer is a teacher, he can write a notebook so that it is read from up to down or he can take advantage of the freedom of non-linear execution of a notebook to write his scenario. For example, the teacher's notebook contains the course and application exercises. In this case, there are many pedagogical possibilities for writing this document. The exercises integrated in the course, the course and exercises separately or the simplest exercises in the course and the others at the end. Each of these teaching strategies imposes a different reading of the notebook. The first one corresponds to a top-down reading and the two others to a non-linear reading of the notebook. Similarly all exercises are not constructed in the same way. An exercise may contain independent questions that can be read and written in any order, or nesting questions that require a specific order, or both. Currently the writer has no other choice to explain the logical structure of his notebook than to use text (or symbols) to guide the reader. A lot of studies have extensively explored models of reading comprehension. These models relate reader characteristics, text content and design, reading instructions (McNamara & Magliano, 2009) and the effects of digital reading compared reading paper (Lenhard, Schroeders, & Lenhard, 2017; Mangen, Walgermo, & Brønnick, 2013; Singer & Alexander, 2017a). A meta-analysis on the effects of reading media on reading comprehension (PabloDelgado 2018) clearly shows a lower reading comprehension outcomes for digital texts compared to printed texts. The study also highlights that the negative impact of digital reading on understanding and learning has increased over the past 18 years, regardless of age group. This results are surprising when you think that children are exposed to digital devices earlier and earlier in their lives. It is difficult to find the causes of these results, the Shallowing Hypothesis is that digital media are often associated with rapid interactions with immediate rewards. But an encouraging conclusion from Lauterman and Ackerman (2014) and Sidi et al. (2017) is that simple methodologies (for example, task framing) that engage people in deep processing can improve digital reading. So it seems very important to try to accompany the reader in the various tasks associated with reading on a Jupyter Notebook.

How to use MOON ?

In the following example the teacher proposes a programming exercise to his students. This exercise consists of 5 steps for which the student must execute in the following order the cells

  • 1 to create a class Card,
  • 3 to define a variable that references a Card object,
  • 5 to display the type of the referenced object
  • 1 to add a constructor to the class

On the left image, the plugin shows the user the accessible cells (light green) at the beginning of the scenario. Red indicates cells that are not yet accessible in the scenario. Any modification and execution of a red cell corresponds to an action that is not recommended by the scenario. On the right image, the plugin indicates in orange the cells of the scenario already modified and executed.

MOON1 MOON2

It is very interesting to notice that the colors (each color is associated with an emoticon) of the cells split the scenario (notebook) into three parts :

  • in orange the part of the scenario already executed,
  • in green what can be done now,
  • in red the part of the scenario that is not yet accessible.

To complete this exercise a sixth step asks the student to create two new cards in two different cells. In this case the student can choose the order in which he completes the cells. On the left image, MOON indicates two accessible cells. On the right image, we can see that the student has chosen to start with the second cell. We also observe that the focus changes the intensity of the color.

MOON2 MOON2

Menu MOON

  • Edit script: Once you have finished editing, you can save your script by saving the notebook.

save

  • Load script: If a script has been saved, just click on the load menu to activate it on the notebook.
  • Current script: Displays the current script.

How to create a script ?

Once the plugin is installed, it is very easy to create a script. In the MOON menu of JupyterLab click on Edit Scenario. The syntax to create a script is the following:

  • a linear sequence of cells is noted CiCj...Cn where the subscripts i,j,n represent the cell numbers. For a best readability you can add spaces between cells.
  • cells accessible in any order are noted between square brackets [CiCj...Cn]
  • an optional cell is preceded by a question mark ?Ci
  • The first cell of a notebook is C0

The script of the previous exercise is C1C3C5C1[C8C9] or C1 C3 C5 C1 [C8 C9].

Advanced usage

MOON allows to describe several levels of scenarios. One for the sequence of exercises as well as scenarios adapted for each exercise. Let's take the example of a notebook with two independent exercises with two questions to do in order for each exercise.

The corresponding script is [ ( C1 C2 ) ( C4 C5 ) ]. The two exercises which are linear sequences are delimited by parantheses. The brackets indicate that the two exercises can be done in any order. In the following image MOON displays in green the two cells corresponding to the start of each exercise (C1 and C4). Answering the first question of one of the exercises allows to switch to the scenario of the corresponding exercise. In the example below the user starts with exercise 2 (cell C4). Once exercise 2 is completed, MOON proposes the different possibilities available to the user. Only exercise 1 remains and MOON display the cell C1 in green

save save save save

To the left of each cell, there is an emoticon to indicate the next step(s) and the number of the cell, which is very useful when writing the script of a scenario

Here is another example of a slightly complicated script : ( ( C1 C3 C5 ) ?( C7 [ C9 C11 ] ) [ C13 C15 ] )

In general, the script can be described as follows. There is a main linear sequence of 3 main tasks.

  • The first one contains 3 sub-tasks (C1 C3 C5) to be done in order.
  • The second one is optional. It contains a linear sequence with one sub-task (C7) and a sub-sequence with two sub-tasks [C9 C11] that can be done in any order.
  • The third and last task contains 2 sub-tasks [C13 C15] to be done in any order.

TODO

  • Load a script. (Done 24/06/2022)
  • Save a script automatically in the notebook metadatas. (Done 24/06/2022)
  • Nested operators. (Done 18/09/2022)
  • Colored the descriptive text of the code cell. (Done 14/10/2022)
  • Automatic adaptation of the script if the user adds/removes cells that are not in the script. (Done 20/10/2022)
  • Launch the automaton from a step of the scenario.
  • Create the scripts graphically with the mouse by clicking on the cells.