Skip to content

Instantly share code, notes, and snippets.

View jcrist's full-sized avatar

Jim Crist-Harif jcrist

View GitHub Profile
@jcrist
jcrist / sparse_demo.ipynb
Created October 12, 2018 19:22
Sparse Tensor Decomposition with Tensorly
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jcrist
jcrist / bench.py
Last active January 28, 2024 11:59
Vaex String benchmarks, updated with dask fixes
import vaex
import numpy as np
import dask.dataframe as dd
import dask
import dask.distributed
import json
import os
import time
import argparse
import multiprocessing
@jcrist
jcrist / github-remote-add.sh
Created April 30, 2019 21:12
Add a remote github user account for the current repo
function github-remote-add () {
case $1 in
""|--help|-h)
echo "Usage: github-remote-add USERNAME"
return 1
;;
esac
local root=`git rev-parse --show-toplevel`;
if [ $? -ne 0 ]; then
echo "Not in a git directory"
@jcrist
jcrist / Dockerfile
Last active May 6, 2019 17:29
Hadoop Pseudodistributed Skein debugging
FROM ubuntu:xenial
RUN apt-get update && \
apt-get install -y -q curl bzip2 git && \
rm -rf /var/lib/apt/lists/*
# Install CDH5 in a single node: Pseudo Distributed
# Docs: https://www.cloudera.com/documentation/enterprise/5-6-x/topics/cdh_qs_yarn_pseudo.html
ADD cloudera.pref /etc/apt/preferences.d/cloudera.pref
RUN curl -s https://archive.cloudera.com/cdh5/ubuntu/xenial/amd64/cdh/archive.key | apt-key add - && \
@jcrist
jcrist / matmul.ipynb
Created August 16, 2019 15:39
Benchmarking matmul implementations on small matrices
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jcrist
jcrist / fresnel.py
Created April 3, 2020 00:08
Overload fresnel
import ctypes
import numpy as np
from numba.extending import get_cython_function_address, overload, intrinsic
from numba.errors import TypingError
from numba import cgutils, types
import scipy.special
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jcrist
jcrist / honeycomb.py
Created May 15, 2020 20:32
Using honeycomb with starlette
import beeline
from starlette.exceptions import HTTPException
from starlette.datastructures import Headers
class HoneycombMiddleware:
def __init__(self, app):
self.app = app
@jcrist
jcrist / simplepickle.py
Last active May 29, 2020 17:55
A simple version of pickle
import pickle
import struct
class Memo(object):
def __init__(self):
self.kv = {}
def put(self, item):
ind = self.kv[id(item)] = len(self.kv)
@jcrist
jcrist / README.md
Created July 10, 2020 22:22
SciPy Sprints 2020

Dask SciPy Sprints 2020

Hello! Welcome to the Dask sprints for SciPy 2020.

Getting started contributing

Here's a few links for getting started contributing:

  • Our contributor guide is here. This should cover