Skip to content

Instantly share code, notes, and snippets.

View martindurant's full-sized avatar

Martin Durant martindurant

View GitHub Profile
cpdef void read_bitpacked8(NumpyIO file_obj, int count, NumpyIO o):
# same as np.frombuffer(input, count, dtype=np.uint8)).astype(np.int32)
cdef int i
cdef int* outptr
cdef char* inptr
outptr = <int*>o.get_pointer()
inptr = file_obj.get_pointer()
for i in range(count):
outptr[0] = <int>inptr[0] & 0xff
outptr += 1
2021-03-31 09:24:49,718 - fsspec.reference - DEBUG - _cat_file -- Reference: .zgroup, type str
2021-03-31 09:24:49,721 - fsspec.reference - DEBUG - _cat_file -- Reference: crs/.zarray, type str
2021-03-31 09:24:49,722 - fsspec.reference - DEBUG - _cat_file -- Reference: crs/.zarray, type str
2021-03-31 09:24:49,722 - fsspec.reference - DEBUG - _cat_file -- Reference: crs/.zattrs, type str
2021-03-31 09:24:49,723 - fsspec.reference - DEBUG - _cat_file -- Reference: elevation/.zarray, type str
2021-03-31 09:24:49,724 - fsspec.reference - DEBUG - _cat_file -- Reference: elevation/.zarray, type str
2021-03-31 09:24:49,725 - fsspec.reference - DEBUG - _cat_file -- Reference: elevation/.zattrs, type str
2021-03-31 09:24:49,726 - fsspec.reference - DEBUG - _cat_file -- Reference: feature_id/.zarray, type str
2021-03-31 09:24:49,726 - fsspec.reference - DEBUG - _cat_file -- Reference: feature_id/.zarray, type str
2021-03-31 09:24:49,727 - fsspec.reference - DEBUG - _cat_file -- Reference: feature_id/.zattrs, type str
import mmap
import tempfile
import weakref
import uuid
import SharedArray as sa
import numpy as np
"""https://gitlab.com/tenzing/shared-array"""
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@martindurant
martindurant / pangeo_csv.py
Created September 18, 2019 21:59
Pangeo CSV loader
from intake.catalog import Catalog
from intake.catalog.local import LocalCatalogEntry
import pandas as pd
class PangeoCSVSource(Catalog):
_grid = [None]
container = 'catalog'
name = 'pangeo_csv'
version = '0.0.1'
@martindurant
martindurant / fdviz.py
Last active May 14, 2019 14:19
panel funs
import inspect
import panel
import hvplot.pandas
from hvplot import hvPlot
from hvplot.converter import HoloViewsConverter
plot_types = list(_ for _ in dir(hvPlot) if not _.startswith('_'))
plots_needs = {
k: set(inspect.signature(getattr(hvPlot, k)).parameters) - {'self', 'kwds'}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
sources:
glob_source:
description: glob of files
driver: csv
cache:
- argkey: urlpath
regex: 's3://bucket'
sub: {{ CACHE_DIR }}
args:
@martindurant
martindurant / bokeh_tricks.py
Created May 23, 2018 16:31
interactive image
import bokeh
from bokeh.io import output_notebook, push_notebook
output_notebook()
##
import numpy as np
from ipywidgets import interact, widgets
from bokeh.plotting import figure, show
@martindurant
martindurant / fuse_test.ipynb
Created February 23, 2018 18:51
GCS FUSE latest
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.