Skip to content

Running the interactive examples

Every block labeled PYTHON · LIVE runs real matmalib Python code in your browser, using Pyodide. No server executes your code, and no account or API key is needed.

Controls

Control Behavior
Run or Ctrl/⌘ + Enter Execute the edited example and display text and Matplotlib figures
Stop Terminate the Python worker, including an infinite loop; the next run reloads Python
Reset Restore that example's original source and clear its output
Copy Copy the edited source for a notebook or local script
Download links Save files produced by a run, such as CSV, XYZ, PNG, or SVG

Tab moves focus between controls. Use spaces to indent code. Examples remain readable when JavaScript is disabled, but execution needs JavaScript, WebAssembly, and a current browser.

What runs where

Python and its scientific packages download only after you select Run. The first run can take a minute or longer on a slow connection; progress appears below the editor. Loading uses the pinned Pyodide 0.29.3 runtime from jsDelivr and pure Python packages from PyPI. An internet connection to these services is required for initial loading. This is not an offline application.

The source for this documented checkout and the sample XYZ structures are bundled with the site. They are not fetched from the latest PyPI matmalib release. Changing the repository and rebuilding the site updates the examples too.

Each run gets a fresh variable namespace and resets Matplotlib configuration. The Python interpreter, imported modules, and virtual files persist between runs on the same page. Refresh the page or use Stop during execution for a completely new interpreter. Navigation to another page also starts a new session. Examples are written to run independently.

The worker keeps the page responsive. One example runs at a time. You may edit other cells while one runs; their Run buttons become available when it finishes.

Files, figures, and limits

The sample files live at data/glucose.xyz, data/glycan.xyz, data/glucose_puckers.xyz, and data/fucosylated_trisaccharide.xyz. Python's initial working directory is /home/pyodide. Paths refer to the browser's temporary virtual filesystem, not files on your computer. Edits and generated files are lost on refresh; download what you want to keep.

Matplotlib uses a static rendering backend. Up to 12 open figures are displayed after a run. Newly written or changed files below /home/pyodide receive download links, excluding package internals and sample data. Downloads are limited to 5 MB per file and 15 MB per run; printed streams are capped at 100,000 characters. Use a local environment for larger work.

State.show() uses a notebook's py3Dmol display integration and is documented as a local notebook example. Interactive 3D notebook displays, desktop GUI windows, external chemistry executables, subprocess workflows, and access to your local directories are outside this runner's scope. The site can generate input files; it does not run Gaussian, CP2K, ORCA, FHI-aims, or GROMACS calculations.

MLMD examples

The MLMD tutorials combine local simulation scripts with live configuration and FES-analysis examples. Blocks labeled PYTHON · LIVE can create MLMD configs, read synthetic FES/COLVAR inputs, compute analysis, draw Plot.fes_1d figures, and export results using the base packages.

ASE dynamics, AIMNet/PyTorch inference, GPU execution, Packmol packing, native PLUMED, and HILLS reconstruction run locally with the relevant dependencies. Their ordinary Python/bash blocks have no Run button. Constructing mlmd() in a browser cell does not load models or start molecular dynamics. Browser FES examples use small synthetic data to explain calculations; their outputs are not physical sampling results.

If an example fails

  • Loading stalls: check network access to jsDelivr and PyPI; Stop and retry. Browser extensions may block downloads.
  • Python traceback: read the final error line, inspect your edits, then Reset to restore the original example.
  • Missing file: use a bundled data/... path or run your own file workflow locally.
  • Memory pressure: Stop the worker, close other tabs, or move the larger calculation to a local environment.
  • Different numerical results locally: runtime dependency versions differ from your installation. Check units and conventions and use identical atom order, selections, and input coordinates when comparing.

Install locally or download the fixtures.