Skip to content

Instantly share code, notes, and snippets.

View ethanwhite's full-sized avatar

Ethan White ethanwhite

View GitHub Profile
@ethanwhite
ethanwhite / spocc_gbif_limit.md
Created October 16, 2019 20:39
spocc GBIF limit issue

Worked a few days ago, now errors

dipo_df = occ(query = "Dipodomys spectabilis", 
  from = "gbif",
  limit = 1000,
  has_coords = TRUE)

Warning messages:
1: gbif: No records returned in GBIF for Dipodomys spectabilis 
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Keybase proof

I hereby claim:

  • I am ethanwhite on github.
  • I am ethanwhite (https://keybase.io/ethanwhite) on keybase.
  • I have a public key whose fingerprint is C8A0 514B EB42 6936 FB37 2900 5882 6D7C E10D CD71

To claim this, I am signing this object:

@ethanwhite
ethanwhite / gdal_examp.py
Created November 20, 2014 01:37
Minimal case for issue with netcdf files and gdal on Anaconda
from osgeo import gdal
gdal.AllRegister()
driver = gdal.GetDriverByName("netCDF")
gdal.Open("test.nc")
@ethanwhite
ethanwhite / setup.py
Created November 19, 2014 22:15
Simple example of setup.py
from setuptools import setup
setup(
name="UltimateAnswer",
version="0.1",
entry_points = {'console_scripts': ['ult-ans = ultimate_answer:main']},
py_modules = ['ultimate_answer']
)
@ethanwhite
ethanwhite / species_regex.py
Created November 3, 2014 22:52
regex example
import re
inputfile = open('wikipedia_rodents.txt', 'r')
def get_species(inputstring):
species_regexs = "([A-Z][a-z]+ [a-z]+)"
species_search = re.search(species_re, inputstring)
if species_search:
return species_search.group(1)
@ethanwhite
ethanwhite / mymath.py
Created October 24, 2014 00:01
Simple Python nose testing example
from __future__ import division
def add(num1, num2):
assert type(num1) == int or type(num1) == float
assert type(num2) == int or type(num2) == float
return num1 + num2
def divide(numerator, denominator):
return numerator / denominator
@ethanwhite
ethanwhite / git_head_hash.py
Created June 29, 2014 02:56
Get hash of current git HEAD using Python built-ins
import subprocess
process = subprocess.Popen(['git', 'rev-parse', 'HEAD'], shell=False, stdout=subprocess.PIPE)
git_head_hash = process.communicate()[0].strip()