https://github.com/jupyterphysscilab/jupyter-instructortools

Tools for making JupyterPhysSciLab notebook templates for student handouts

https://github.com/jupyterphysscilab/jupyter-instructortools

Science Score: 23.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    1 of 1 committers (100.0%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (12.5%) to scientific vocabulary

Keywords

educational-software educational-technology jupyter jupyter-notebook pandas plotting python
Last synced: 5 months ago · JSON representation

Repository

Tools for making JupyterPhysSciLab notebook templates for student handouts

Basic Info
  • Host: GitHub
  • Owner: JupyterPhysSciLab
  • License: bsd-3-clause
  • Language: TypeScript
  • Default Branch: master
  • Size: 132 KB
Statistics
  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 7
Topics
educational-software educational-technology jupyter jupyter-notebook pandas plotting python
Created almost 6 years ago · Last pushed over 1 year ago
Metadata Files
Readme Changelog License

README.md

jupyter-instructortools

Introduction | Usage | Current Menu Items | Typical workflow | Install | Issues or Comments | License

Introduction

This adds a menu to Jupyter that automates some useful tasks an instructor might want to do while building a notebook template for an assignment. This is part of the Jupyter Physical Science Lab project, but can be used independently of the rest of the project.

Usage:

The menu that provides access to most of the tools is activated using the "Activate menu" item in the "JPSL Instructor Tools" section of the Jupyter Lab command palette (figure 1). By default it is inactive at the beginning of a session.

Instructor Tool commands in Jupyter Lab command palette

Figure 1: Instructor Tool commands available in the Jupyter lab command palette.

The "Disallow menu in Notebook" option prevents the use of the Instructor Tools menu with the currently focused notebook. This should only be done to the final form of the notebook that will be distributed to students, because it is very difficult to reverse.

Available menu items

  • Create a data input table.
    • Table column and row labels can be locked once set.
    • Number of rows and columns must be chosen on initial creation.
    • Table will survive deletion of all cell output data.
    • The code cell that creates the table is protected.
    • Table creation code will work in a plain vanilla Jupyter install, but the contents of the table cannot be edited.
    • See the jupyter-datainputtable extension for more details.
  • Add some highlight bars to a selected markdown cell. These can be removed by deleting the associated<div>:
    • A vertical cyan bracket at the left of the cell.
    • A vertical red bracket at the left of the cell.
    • A horizontal green start bar (fading down to beige). Useful for indicating the beginning of an instruction block.
    • A horizontal brown stop bar (fading down from beige to brown). Useful for indicating the end of an instruction block.
  • Protect/unprotect selected cells. Protected cells cannot be edited or deleted by the user. This is a good way to prevent instructions and example code from being damaged by students.
  • Set/un-set selected cells as allowed to be hidden. This can be used to mark cells to hide before producing a pdf to turn in.
  • Set/un-set selected cells to collapse code before printing.
  • Set/un-set selected cells to collapse code in JPSL.
  • Temporarily highlight each kind of cell marked for hiding or code collapse.
  • Temporarily completely hide (not collapse) code (all or just selected cells).
  • Insert boilerplate instructions on initializing a notebook into a selected markdown cell.
  • Insert boilerplate instructions on preparing a pdf version of the notebook to turn in with instructor selected parts hidden.

Typical workflow

Work in a virtual environment that includes this tool plus all the tools the students will have access to (see Install).

  1. Start the jupyter notebook server (from the command line use jupyter lab or jupyter notebook).
  2. Open a new notebook and activate the menu using the "Activate menu" item in the "JPSL Instructor Tools" section of the Jupyter Lab command palette (figure 1). By default it is inactive at the beginning of a session.
  3. Build the exercise including instructions, examples, tables (use the menu) and imports.
  4. Collect all the necessary imports into a code cell that will be the first code cell in the worksheet. You may want introductory material before this cell.
  5. Use the menu to protect any cells you do not want students to accidentally alter.
  6. Use the menu to tag cells so they can be hidden. This allows students to print a compressed version of the notebook for grading. Consider hiding most of the instructions.
  7. Restart the kernel and clear all cell outputs. Delete or emtpy any cells that have things you want the students to be filling in.
  8. Save the notebook and make a duplicate of it. Continue working with the duplicate.
  9. Work through the notebook as if you were a student, make adjustments as you go. Iterate restarting the kernel, clearing the cell outputs, saving, duplicating and working though until satisfied.
  10. Save the final version of the worksheet. Duplicate it.
  11. Open the duplicate worksheet. Make sure all the appropriate cell data is cleared. Then select "Disallow menu in Notebook" item in the "JPSL Instructor Tools" section of the Jupyter Lab command palette (figure 1). This will deactivate the menu and block students from easily reinstalling it. Save the notebook and distribute this copy to students. <!--
  12. Use the menu to add to this initialization cell the command to get the student names and timestamp the notebook. This will simultaneously protect the cell. --> ## Requirements
  13. JupyterLab >= 4.0.0
  14. notebook >= 7.0.0
  15. jupyter-datainputtable >=0.8.0

Install

Installation using pip into a virtual environment is recommended. My favorite way to manage virtual environments is using pipenv. You should also consider venv which is part of the standard Python library and hatch for development.

Option 1: Recommended, as this will install all of the Jupyter Physical Science Lab packages an Instructor might need. Use the JPSLInstructor pseudo package.

bash pip install JPSLInstructor

Option 2: Install just this package and its minimal requirements. You may want to do this if you are just making worksheets, do not need live data acquisition or want to use a very specific set of packages.

bash pip install jupyter_instructortools

Contributing

Development install

Note: You will need NodeJS to build the extension package.

The jlpm command is JupyterLab's pinned version of yarn that is installed with JupyterLab. You may use yarn or npm in lieu of jlpm below.

```bash

Clone the repo to your local environment

Change directory to the jupyter_datainputtable directory

Install package in development mode

pip install -e "."

Link your development version of the extension with JupyterLab

jupyter labextension develop . --overwrite

Rebuild extension Typescript source after making changes

jlpm build ```

You can watch the source directory and run JupyterLab at the same time in different terminals to watch for changes in the extension's source and automatically rebuild the extension.

```bash

Watch the source directory in one terminal, automatically rebuilding when needed

jlpm watch

Run JupyterLab in another terminal

jupyter lab ```

With the watch command running, every saved change will immediately be built locally and available in your running JupyterLab. Refresh JupyterLab to load the change in your browser (you may need to wait several seconds for the extension to be rebuilt).

By default, the jlpm build command generates the source maps for this extension to make it easier to debug using the browser dev tools. To also generate source maps for the JupyterLab core extensions, you can run the following command:

bash jupyter lab build --minimize=False

Development uninstall

bash pip uninstall jupyter_instructortools

In development mode, you will also need to remove the symlink created by jupyter labextension develop command. To find its location, you can run jupyter labextension list to figure out where the labextensions folder is located. Then you can remove the symlink named jupyter-instructortools within that folder.

Testing the extension (currently incomplete)

Frontend tests

This extension is using Jest for JavaScript code testing.

To execute them, execute:

sh jlpm jlpm test

Integration tests

This extension uses Playwright for the integration tests (aka user level tests). More precisely, the JupyterLab helper Galata is used to handle testing the extension in JupyterLab.

More information are provided within the ui-tests README.

Packaging the extension

See RELEASE

Issues or comments

Issues or bugs should be reported via the project's issues pages.

Copyright - Jonathan Gutow, 2020 - 2024.

Owner

  • Name: Jupyter Physical Science Lab
  • Login: JupyterPhysSciLab
  • Kind: organization

Tools for physical science data acquistion and analysis within Jupyter notebooks

GitHub Events

Total
Last Year

Committers

Last synced: about 2 years ago

All Time
  • Total Commits: 41
  • Total Committers: 1
  • Avg Commits per committer: 41.0
  • Development Distribution Score (DDS): 0.0
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Jonathan Gutow g****w@u****u 41
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 4
  • Total pull requests: 1
  • Average time to close issues: over 1 year
  • Average time to close pull requests: 6 days
  • Total issue authors: 1
  • Total pull request authors: 1
  • Average comments per issue: 2.0
  • Average comments per pull request: 1.0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 1
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • gutow (4)
Pull Request Authors
  • dependabot[bot] (1)
Top Labels
Issue Labels
enhancement (3) help wanted (1) question (1)
Pull Request Labels
dependencies (1)

Packages

  • Total packages: 2
  • Total downloads:
    • pypi 66 last-month
    • npm 4 last-month
  • Total dependent packages: 0
    (may contain duplicates)
  • Total dependent repositories: 1
    (may contain duplicates)
  • Total versions: 20
  • Total maintainers: 1
pypi.org: jupyter-instructortools

Tool to assist instructors in creating notebook templates for student Jupyter worksheets.

  • Homepage: https://github.com/JupyterPhysSciLab/jupyter-instructortools
  • Documentation: https://jupyter-instructortools.readthedocs.io/
  • License: BSD 3-Clause License Copyright (c) 2024, Jonathan Gutow All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  • Latest release: 0.8.0
    published over 1 year ago
  • Versions: 18
  • Dependent Packages: 0
  • Dependent Repositories: 1
  • Downloads: 66 Last month
Rankings
Dependent packages count: 7.3%
Dependent repos count: 22.1%
Average: 26.0%
Forks count: 30.0%
Downloads: 31.5%
Stargazers count: 38.9%
Maintainers (1)
Last synced: 6 months ago
npmjs.org: jupyter-instructortools

Tool to assist instructors in creating notebook templates for student Jupyter worksheets.

  • Versions: 2
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 4 Last month
Rankings
Dependent repos count: 27.1%
Average: 33.2%
Dependent packages count: 39.4%
Maintainers (1)
Last synced: 6 months ago

Dependencies

setup.py pypi
  • JPSLMenus *
  • JPSLUtils >=0.7.2
  • jupyter >=1.0.0
  • jupyter-datainputtable >=0.7.5
  • notebook >=6.4.12
  • pandas >=0.22.0
  • python >=3.6