Skip to content

Instantly share code, notes, and snippets.

Genevieve Buckley GenevieveBuckley

  • Monash University
  • Melbourne
Block or report user

Report or block GenevieveBuckley

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
GenevieveBuckley / .gitignore
Created May 2, 2019
Python .gitignore template file
View .gitignore
# Sphinx docs
# Logging
# Testing and coverage
View python_wheels.txt
# Installing a python wheel
pip install some-package.whl
# Creating a python wheel
pip wheel --wheel-dir=path/to/save/wheel wheel_filename
# See
# PEP427 (describes the wheel format)
GenevieveBuckley / 2to3
Created Apr 30, 2019
Converting python 2 code to python 3
View 2to3
For the whole repository:
$ 2to3 --output-dir=python3-version/mycode -W -n python2-version/mycode
For a single file:
$ 2to3
# See details at:
# Stack overflow
GenevieveBuckley / pytest-mpl.txt
Created Apr 30, 2019
Testing matplotlib image outputs with the pytest-mpl plugin
View pytest-mpl.txt
# To generate baseline images
py.test --mpl-generate-path=baseline
# To run pytest with the matplotlib plugin
py.test --mpl
# See full details here
GenevieveBuckley /
Last active Apr 16, 2019 — forked from emmanuelle/
Inspect which functions of scikit-image are compatible with 3-D arrays.
import numpy as np
import inspect
from skimage import exposure, feature, filters, measure, morphology, \
restoration, segmentation, transform, util
def only_one_nondefault(args):
Returns True if the function has only one non-keyword parameter,
False otherwise.
GenevieveBuckley /
Created Apr 15, 2019
Log all uncaught exceptions to file with sys.excepthook
import os
import logging
import sys
import time
import traceback
from mypackage import __version__
def _exception_handler(error_type, error_value, error_traceback):
GenevieveBuckley / link_with_spaces.rst
Created Apr 3, 2019
Link with spaces in restructured text (.rst) files
View link_with_spaces.rst
# delete local tag '12345'
git tag -d 12345
# delete remote tag '12345' (eg, GitHub version too)
git push origin :refs/tags/12345
# alternative approach
git push --delete origin tagName
git tag -d tagName
GenevieveBuckley / settings.json
Last active May 2, 2019
Visual Studio Code settings.json config file
View settings.json
"editor.rulers": [
"autoDocstring.docstringFormat": "numpy",
"python.linting.pylintEnabled": false,
"python.linting.flake8Enabled": true,
"window.zoomLevel": 0,
"python.formatting.provider": "autopep8",
"editor.formatOnSave": true,
GenevieveBuckley / pytest.ini
Last active Apr 4, 2019
Pytest configuration file
View pytest.ini
addopts = --cov-report xml:cov.xml --cov-report term-missing --cov=mypackagename
You can’t perform that action at this time.