Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Register
  • Sign in
  • O ogs
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
    • Locked files
  • Issues 109
    • Issues 109
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 41
    • Merge requests 41
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • ogsogs
  • ogs
  • Merge requests
  • !4502

[T,nb,ci] Add support for markdown-based notebooks via jupytext

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Lars Bilke requested to merge bilke/ogs:jupytext into master Feb 28, 2023
  • Overview 26
  • Commits 14
  • Pipelines 10
  • Changes 37
  • Prove of concept for markdown-based notebooks via jupytext.

  • Example conversion of Linear_Disc_with_hole-notebook (web preview here).

  • Adds button to launch the notebook in BinderHub. Works with newly created MR notebooks too (see web preview above)! CleanShot_2023-03-01_at_10.44.22_2x

    • The BinderHub config is here: https://github.com/bilke/binder-ogs-requirements (may migrate this to GitLab ogs-group later)
    • When clicking the link it launches a Jupyter Lab instance pre-configured with ogs via wheel, clones the current ogs repo in it and opens the respective notebook ready to run. Please note that startup times may be several minutes and the computing resources are limited (1 core, 2GB RAM). For improved performance we would need to setup own infrastructure. Also currently only works for serial ogs configs.
  • notebook file parameter in Notebook meta data is now computed automatically @chleh.

  • Some ipynb notebooks needed to be converted to newer format (nbformat 4.5).


General consequences of using Markdown-based notebooks based on jupytext:

  • Edit notebook just with a text editor
  • Better git diffs, easier MR reviews
  • If Jupyter Lab configured properly then transparent usage:
    • Double-click on a markdown file will open it as a Notebook
    • Upon saving or executing a linked .ipynb-file is created in the background which stores outputs
    • You still edit the Markdown file but don't notice the difference to regular notebooks in the Lab UI
  • If OGS_USE_PIP=ON you get a properly configured environment in [build-dir]/.venv. Simply activate it and start jupyter lab.

  1. Feature description was added to the changelog
  2. Tests covering your feature were added?

Follow-up TODOS:

  • Any new feature or behavior change was documented? There will be a subsequent MR unifying existing notebook docs and showing usage, !4512 (merged)
  • Converting existing notebooks to markdown
  • Disallowing .ipynb-files in the repo.
Edited Mar 06, 2023 by Lars Bilke
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: jupytext