import holoviews as hv from holoviews import opts from holoviews.operation import contours hv.extension('matplotlib') penguins = hv.RGB.load_image('../assets/penguins.png') hv.save(penguins, 'penguin_plot.png', fmt='png') penguins hv.archive.auto() penguins[:,:,'R'].relabel("Red") + penguins[:,:,'G'].relabel("Green") + penguins[:,:,'B'].relabel("Blue") penguins * hv.Arrow(0.15, 0.3, 'Penguin', '>') cs = contours(penguins[:,:,'R'], levels=[0.10,0.80]) overlay = penguins[:, :, 'R'] * cs overlay.opts( opts.Contours(linewidth=1.3, cmap='Autumn'), opts.Image(cmap="gray")) hv.archive.contents() hv.archive.filename_formatter="{SHA:.8}" cs hv.archive.contents() import json hv.archive.add(filename='metadata.json', data=json.dumps({'repository':'git@github.com:ioam/holoviews.git', 'commit':'437e8d69'}), info={'mime_type':'text/json'}) hv.archive.contents() listing = hv.archive.listing() listing hv.archive.export() import os os.getcwd() if os.path.exists(hv.archive.notebook_name): print('\n'.join(sorted(os.listdir(hv.archive.notebook_name)))) hv.archive.last_export_status() import os from holoviews.core.io import Unpickler c, a = None,None hvz_file = [f for f in listing if f.endswith('hvz')][0] path = os.path.join(hv.archive.notebook_name, hvz_file) if os.path.isfile(path): print('Unpickling {filename}'.format(filename=hvz_file)) obj = Unpickler.load(open(path,"rb")) print(obj) else: print('Could not find file {path}'.format(path=path)) print('Current directory is {cwd}'.format(cwd=os.getcwd())) print('Containing files and directories: {listing}'.format(listing=os.listdir(os.getcwd())))