Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

using Pkg
Pkg.activate(".")
using TensorCast
using CuArrays
using BenchmarkTools
BenchmarkTools.DEFAULT_PARAMETERS.seconds = 0.5
function test_cast(T)
@jfeist
jfeist / Jupyter tips & tricks.md
Last active December 14, 2019 11:29
Jupyter tips & tricks

Jupyter Notebook extensions

Very useful collection of extensions for Jupyter Notebook (not JupyterLab though): https://github.com/ipython-contrib/jupyter_contrib_nbextensions - installed on soleus, all the extensions can be activated/configured through the "Nbextensions" tab in the notebook tree view (the "file explorer").

Matplotlib

style files

I have written two matplotlib style files, jf.mplstyle (default line colors based on seaborn with small modifications) and jf_cb.mplstyle (default line colors based on recommendations for viewers with colorblindness from Nature Methods 8, 441 (2011)). To use these, you can either (after having run import matplotlib.pyplot as plt or %pylab inline before)

  • call plt.style.use('https://johannesfeist.eu/misc/jf.mplstyle') in your python notebook to use the style file you want directly from my server.
  • or download the file and save it into into your local matplotlib style directo
#!/bin/sh
jq -r 'def banner: "\(.) " + (28-(.|length))*"-";
("Non-cell info" | banner), del(.cells), "",
(.cells[] | ("\(.cell_type) cell" | banner),
"\(.source|add)",
if ($show_output == "1") then
"",
( select(.cell_type=="code" and (.outputs|length)>0) |
("output" | banner),
(.outputs[] |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.