title: How to MyST, without being mystified 🧙 subject: Tutorial subtitle: Evolve your markdown documents into structured data short_title: How to MyST authors:
- name: Rowan Cockett
affiliations:
- Executable Books
- Curvenote
title: How to MyST, without being mystified 🧙 subject: Tutorial subtitle: Evolve your markdown documents into structured data short_title: How to MyST authors:
import numpy as np | |
import matplotlib.pyplot as plt | |
from matplotlib.colors import LogNorm # Add this import | |
# Generate some sample data | |
np.random.seed(42) | |
angles = np.random.uniform(0, 2*np.pi, 1000) | |
radii = np.random.normal(5, 1, 1000) | |
# Create a polar subplot |
[1 million of these cargo warnings (more than my terminal cache allows] | |
cargo:warning= 657 | class WXDLLIMPEXP_FWD_CORE wxKeyEvent; | |
cargo:warning= | ^~~~~~~~~~ | |
cargo:warning=src/sys/form/form.cpp:315:9: error: invalid use of incomplete type ‘class wxKeyEvent’ | |
cargo:warning= 315 | event.Skip(); | |
cargo:warning= | ^~~~~ | |
cargo:warning=In file included from /usr/include/wx-3.0/wx/wx.h:24, | |
cargo:warning= from src/sys/form/../common/common.h:27, | |
cargo:warning= from src/sys/form/form.cpp:22: | |
cargo:warning=/usr/include/wx-3.0/wx/event.h:657:28: note: forward declaration of ‘class wxKeyEvent’ |
from configparser import ConfigParser | |
import subprocess | |
config = ConfigParser(delimiters=["="]) | |
config.read("settings.ini") | |
cfg = config["DEFAULT"] | |
requirements = cfg.get("requirements", "").split() | |
with open("environment.yml", "w") as f: | |
f.write("name: testenv\n") |
""" | |
Export a Conda environment with --from-history, but also append | |
Pip-installed dependencies | |
Exports only manually-installed dependencies, excluding build versions, but | |
including Pip-installed dependencies. | |
Lots of issues requesting this functionality in the Conda issue tracker, no | |
sign of progress (as of March 2020). |
[LabBuildApp] Building in /home/maye/miniconda3/envs/py38/share/jupyter/lab | |
[LabBuildApp] Node v16.10.0 | |
[LabBuildApp] Yarn configuration loaded. | |
[LabBuildApp] Building jupyterlab assets (production, minimized) | |
[LabBuildApp] > node /home/maye/miniconda3/envs/py38/lib/python3.8/site-packages/jupyterlab/staging/yarn.js install --non-interactive | |
[LabBuildApp] yarn install v1.21.1 | |
[1/5] Validating package.json... | |
[2/5] Resolving packages... | |
success Already up-to-date. |
# taken from: https://raw.githubusercontent.com/pete88b/decision_tree/master/test_nbs.py | |
# We need a "test_" file with "test_" functions to make it easy to run with pytest | |
# couple of example "test_" functions | |
# import nbdev.test | |
# def test_run(): | |
# print('running nbdev.test.test_nb("20_models.ipynb") ...') |
import os, hashlib, urllib2, optparse | |
def get_remote_md5_sum(url, max_file_size=100*1024*1024): | |
remote = urllib2.urlopen(url) | |
hash = hashlib.md5() | |
total_read = 0 | |
while True: | |
data = remote.read(4096) | |
total_read += 4096 |
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
from datetime import datetime as dt | |
from pathlib import Path | |
from sh import speedtest | |
fname = Path("multiple_connections_triton.csv") |