Skip to main content

utility routines used in PySDM, PyMPDATA and PyPartMC examples and tests

Project description

open-atmos-jupyter-utils

License: GPL v3 Github Actions Status PyPI version Github repo

Features

open-atmos-jupyter-utils is a Python package providing Jupyter notebook utility routines for:

Functions and Examples

  • show_plot() - a drop-in replacement for matplotlib.pyplot.show() that displays figures inline as SVG vector graphics. The function also provides a download widget that allows users to download the figure as PDF or SVG. On Google Colab, the widget triggers a Google Drive download. Example:
    preview notebook launch on mybinder.org launch on Colab
  • show_anim(plot_func: typing.Callable, frame_range: typing.Iterable) - a replacement for matplotlib.animation.FuncAnimation that displays inline animations in GIF format (which is compatible with GitHub rendering). It also provides a download widget to save the animation as a GIF file, with Colab support for Google Drive download. Example:
    preview notebook launch on mybinder.org launch on Colab
  • notebook_vars(notebook: pathlib.Path, plot: bool) - a function that executes notebook code and returns a dictionary of variables present in the notebook. This is particularly useful for setting up automated tests using pytest fixtures without any modification to the original notebooks. The plot flag controls if show_plot() calls within the notebook should be run or not. Example:
    view test
  • pip_install_on_colab('package_a', 'package_b', ...) - a function that automates the installation of Python packages in Colab environments via pip (and ldconfig for system libraries). This ensures smooth setup for notebooks running on Colab.

Usage

For installation use:

pip install open-atmos-jupyter-utils

Then import inside Python project

import open_atmos_jupyter_utils as oaju

Documentation

Public API docs are maintained at: https://open-atmos.github.io/jupyter-utils/

Use Cases

open-atmos-jupyter-utils has been developed for and used in numerous Jupyter notebooks in PySDM, PyMPDATA and PyPartMC projects.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

open-atmos-jupyter-utils-1.3.0.tar.gz (243.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

open_atmos_jupyter_utils-1.3.0-py3-none-any.whl (19.6 kB view details)

Uploaded Python 3

File details

Details for the file open-atmos-jupyter-utils-1.3.0.tar.gz.

File metadata

  • Download URL: open-atmos-jupyter-utils-1.3.0.tar.gz
  • Upload date:
  • Size: 243.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for open-atmos-jupyter-utils-1.3.0.tar.gz
Algorithm Hash digest
SHA256 3d1d4150e9476476021a9798085f2eede023848a7db0aec6e403c57467436fc3
MD5 956542f314f72a22f505019a7dba1147
BLAKE2b-256 984a14ac4f72f553eee8387b914f4eb1294cedd21c29d48aba94cd1cbbbcac28

See more details on using hashes here.

File details

Details for the file open_atmos_jupyter_utils-1.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for open_atmos_jupyter_utils-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e3a0ff9aaadb4e540f31aebf633a24e641cfe39587f5270f053fac24c40a8b37
MD5 1051b3c0e1c2831439c69f50a21f5535
BLAKE2b-256 a9c9561c52c985fbc2f786b75291cd7331d229ef6a56dc24d96cbf79ed0b4e9a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page