Skip to content

Instantly share code, notes, and snippets.

View asford's full-sized avatar

Alex Ford asford

View GitHub Profile
@seberg
seberg / rolling_window.py
Created October 10, 2012 14:38
Multidimensional rolling_window for numpy
def rolling_window(array, window=(0,), asteps=None, wsteps=None, axes=None, toend=True):
"""Create a view of `array` which for every point gives the n-dimensional
neighbourhood of size window. New dimensions are added at the end of
`array` or after the corresponding original dimension.
Parameters
----------
array : array_like
Array to which the rolling window is applied.
window : int or tuple
@ogrisel
ogrisel / class_def_pickling.py
Last active December 10, 2015 17:48
Pickling class definitions for IPython.parallel
import inspect
from pickle import loads, dumps
from IPython.utils import pickleutil
def class_dumps(cls):
canned_dict = pickleutil.canDict(
dict((k, v) for k, v in cls.__dict__.items()
if k not in ('__weakref__', '__dict__')))
parents = tuple(cls.mro())
@tmcw
tmcw / xyz_vs_tms.md
Last active August 20, 2024 16:47
The difference between XYZ and TMS tiles and how to convert between them

The difference between XYZ and TMS tiles and how to convert between them

Lots of tile-based maps use either the XYZ or TMS scheme. These are the maps that have tiles ending in /0/0/0.png or something. Sometimes if it's a script, it'll look like &z=0&y=0&x=0 instead. Anyway, these are usually maps in Spherical Mercator.

Good examples are OpenStreetMap, Google Maps, MapBox, MapQuest, etc. Lots of maps.

Most of those are in XYZ. The best documentation for that is slippy map tilenames on the OSM Wiki, and Klokan's Tiles a la Google.

@hgrecco
hgrecco / tasks.py
Last active June 22, 2022 07:49
Simple concurrent tasks with dependencies in Python.
from collections import defaultdict
import concurrent.futures
class TasksGroup(object):
"""A group of tasks with dependencies.
>>> tasks = TasksGroup()
>>> @tasks.add()
@ufechner7
ufechner7 / linalg_3.py
Created April 1, 2015 11:07
Fast linear algebra for 3D vectors using numba 0.17 or newer
# -*- coding: utf-8 -*-
"""
* This file is part of FreeKiteSim.
*
* FreeKiteSim -- A kite-power system power simulation software.
* Copyright (C) 2013 by Uwe Fechner, Delft University
* of Technology, The Netherlands. All rights reserved.
*
* FreeKiteSim is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@andreasprlic
andreasprlic / webgl_protein_viewers.md
Last active December 30, 2017 02:30
WebGL based protein Viewers

A collection of WebGL based protein viewers on the Web.

=======================================================

An increasing number of WebGL based protein viewers are becoming available. Here a collection of all the viewers that I could find so far (sorted alphabetically).

3Dmol

http://3dmol.csb.pitt.edu/

pdf

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dmnsgn
dmnsgn / WebGL-WebGPU-frameworks-libraries.md
Last active November 17, 2024 08:50
A collection of WebGL and WebGPU frameworks and libraries

A non-exhaustive list of WebGL and WebGPU frameworks and libraries. It is mostly for learning purposes as some of the libraries listed are wip/outdated/not maintained anymore.

Engines and libraries ⚙️

Name Stars Last Commit Description
three.js ![GitHub