Skip to content

Instantly share code, notes, and snippets.

View jsignell's full-sized avatar

Julia Signell jsignell

View GitHub Profile
@jsignell
jsignell / RGB.ipynb
Created December 17, 2018 14:58
RGB issues with holoviews
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jsignell
jsignell / panel_file_browser.py
Last active March 20, 2019 19:41
Multipane File Browser implemented in Panel
import os
import panel as pn
path = os.getcwd()
def get(event):
"""When dir selected populate next pane, remove any extra panes"""
got = event.new[0]
if os.path.isdir(got):
items = sorted(os.listdir(got))
@jsignell
jsignell / custom_plotting.ipynb
Created March 21, 2019 20:35
Custom Plotting using Intake, hvplot, and panel
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import os
from collections import OrderedDict
import panel as pn
path = os.getcwd()
down = '│'
right = '└──'
def expand_dir(event):
import panel as pn
pn.extension()
labels = [t[0] + t[1] + t[2] for t in zip('abcdefghijklmnopqrstuvwxyz','bcdefghijklmnopqrstuvwxyza', 'cdefghijklmnopqrstuvwxyzab')]
options = dict(zip(labels, range(len(labels))))
multi = pn.widgets.MultiSelect(options=options)
sort = pn.widgets.Button(name='▼', width=40)
filt = pn.widgets.AutocompleteInput(options=list(options.keys()), placeholder='Filter')
import panel as pn
pn.extension()
labels = [t[0] + t[1] + t[2] for t in zip('abcdefghijklmnopqrstuvwxyz','bcdefghijklmnopqrstuvwxyza', 'cdefghijklmnopqrstuvwxyzab')]
options = dict(zip(labels, range(len(labels))))
multi = pn.widgets.MultiSelect(options=options)
sort = pn.widgets.Button(name='▼', width=40)
filt = pn.widgets.AutocompleteInput(options=list(options.keys()), placeholder='Filter')
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jsignell
jsignell / intake_live_demo.md
Last active July 10, 2019 21:53
Intake: Basta with the Copy Pasta

Intake: Basta with the Copy Pasta

conda create --name lightning-talk intake
conda activate lightning-talk
conda install -c intake us_crime
ipython

Import intake, inspect the metadata on your data source

def make_dynamic(func):
from collections import defaultdict
from types import FunctionType
import param
try:
import panel as pn
panel_available = True
except:
panel_available = False
def look_for_class(panel, classname, items=None):
"""
Descend a panel object and find any instances of the given class
"""
if items is None:
items = []
if isinstance(panel, pn.layout.ListPanel):
for p in panel:
items = look_for_class(p, classname, items)
elif isinstance(panel, classname):