Skip to content

Instantly share code, notes, and snippets.

@golobor
golobor / centromere_downloader.ipynb
Last active October 29, 2020 07:49
centromere_downloaded
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import bpy
import mathutils
import numpy as np
def add_curve(
coords,
thickness = 0.2,
name='polymer',
resolution=4,
kind='BEZIER'):
@golobor
golobor / test_dask.ipynb
Created April 16, 2017 23:39
dask delayed+arrays for multiprocessing in hdf5
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@golobor
golobor / gridspec_inches.py
Created March 3, 2017 18:04
making grids of plots in units that make sense
def gridspec_inches(
wcols,
hrows,
fig_kwargs={}):
import matplotlib as mpl
import matplotlib.pyplot as plt
fig_height_inches = (
sum(hrows)
@golobor
golobor / dotdict
Last active January 29, 2023 16:42
A simple wrapper to enable dot autocompletion of Python dictionaries
class dotdict(dict):
'''A dict with dot access and autocompletion.
The idea and most of the code was taken from
http://stackoverflow.com/a/23689767,
http://code.activestate.com/recipes/52308-the-simple-but-handy-collector-of-a-bunch-of-named/
http://stackoverflow.com/questions/2390827/how-to-properly-subclass-dict-and-override-get-set
'''
def __init__(self,*a,**kw):