Skip to content

Instantly share code, notes, and snippets.

View jnmclarty's full-sized avatar

Jeffrey McLarty jnmclarty

View GitHub Profile
  • Update HISTORY.rst
  • Update version number in my_project/__init__.py
  • Update version number in setup.py
  • Install the package again for local development, but with the new version number:
python setup.py develop
  • Run the tests:
python setup.py test
@jnmclarty
jnmclarty / By.py
Last active August 29, 2015 14:16
BoxPlot By Year
vsf['year'] = [d.year for d in vsf.index]
vsf[['contribution_room','year']].boxplot(rot=90,by='year')
@jnmclarty
jnmclarty / SmuggleTest.sh
Created March 2, 2015 02:02
Testing Commands for Smuggle
nosetests --with-coverage --cover-package=smuggle -s
py.test --cov=smuggle --cov-report=term --cov-report=html
@jnmclarty
jnmclarty / setup python
Last active August 29, 2015 14:16
Commands for New VMs
sudo apt-get update
sudo apt-get install virtualbox-guest-dkms
sudo apt-get install git
sudo apt-get install python-pip
sudo pip install spyder
sudo pip install matplotlib
sudo apt-get install python-qt4 python-sphinx python-numpy python-pandas
@jnmclarty
jnmclarty / QuasiODict.py
Created March 18, 2015 03:43
SQLA QuasiODict
class ProxyODict(object):
def __init__(self, parent, collection_name, childclass, ordername, keyname, valuename):
self.parent = parent
self.collection_name = collection_name
self.childclass = childclass
self.ordername = ordername
self.keyname = keyname
self.valuename = valuename
@property
@jnmclarty
jnmclarty / pypackagref.md
Created August 5, 2015 01:24
Python Packaging References
@jnmclarty
jnmclarty / .pypirc
Created August 15, 2015 13:01
Multiple Server config for pypi
[distutils]
index-servers =
pypi
pypitest
[pypi]
repository: https://pypi.python.org/pypi
username: jmclarty
password:
@jnmclarty
jnmclarty / dry_checker.py
Last active September 6, 2015 14:15
Code Duplication Checker
# -*- coding: utf-8 -*-
"""
Created on Sun Sep 06 07:29:38 2015
@author: Jeffrey
"""
"""
Python code clone detector,
using Abstract Syntax Trees.
@jnmclarty
jnmclarty / partial.py
Last active December 1, 2015 02:42
partial usage of partial
from functools import partial
import os
rel_path = partial(os.path.join, os.path.dirname(__file__))
f = rel_path("../config/foo.ini")
print_stderr = partial(print, file=sys.stderr)