Skip to content

Instantly share code, notes, and snippets.

View sgillies's full-sized avatar

Sean Gillies sgillies

View GitHub Profile
from math import sqrt
from matplotlib import pyplot
from shapely.geometry import *
GM = (sqrt(5)-1.0)/2.0
W = 8.0
H = W*GM
SIZE = (W, H)
COLORS = ['#6699cc', '#ffcc33']
Here's an attempt to log coverage.
commit 73344c76b2c34beb066ffe22548cf56a0d064e47
Author: sgillies <sean.gillies@gmail.com>
Date: Thu Sep 9 14:01:39 2010 -0600
$ coverage -e
$ coverage -x setup.py test
$ coverage -r shapely/*.py shapely/geometry/*.py
Name Stmts Exec Cover
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
>>> name = 'ⲙⲛⲧⲣⲙⲛⲕⲏⲙⲉ'.decode('utf-8')
>>> transliterate_name('cop', name)
'mntrmnkeme'
@sgillies
sgillies / Results
Created April 25, 2011 18:02
Shapely speedups benchmarks
(gispy-lab)krusty-2:Shapely-1.2 seang$ python speedups-benchmark.py
N=10
======
Without speedups
74.75 usec/pass
With speedups
19.80 usec/pass
@sgillies
sgillies / pipelinedemo.py
Created September 21, 2011 18:14
Data processing pipeline demo
# pipelinedemo.py
# Data processing pipeline demo
from json import dumps
import logging
def coroutine(func):
"""Used as a decorator, advances a generator to active it"""
def start(*args,**kwargs):
cr = func(*args,**kwargs)
@sgillies
sgillies / geojson-spec-1.0
Created September 21, 2011 21:11
The GeoJSON Specification
================================
The GeoJSON Format Specification
================================
:Abstract:
GeoJSON is a geospatial data interchange format based on JavaScript Object
Notation (JSON).
:Authors:
Howard Butler (Hobu Inc.),
@sgillies
sgillies / pleiades-related-photos.py
Created December 15, 2011 19:29
Flickr API results processed to make JSON for a Pleiades sidebar item
@sgillies
sgillies / 440947682.json
Created December 16, 2011 22:17
Fetching and formatting Pleiades GeoJSON
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@sgillies
sgillies / mersh.txt
Created January 27, 2012 16:57
Mersh.txt requirements file for pip
Fiona==0.8
Pyproj==1.9.0
Shapely==1.2.14