Skip to content

Instantly share code, notes, and snippets.

View GenevieveBuckley's full-sized avatar

Genevieve Buckley GenevieveBuckley

  • Monash University
  • Melbourne
View GitHub Profile
@GenevieveBuckley
GenevieveBuckley / markdown-details-collapsible.md
Created February 28, 2019 03:14 — forked from pierrejoubert73/markdown-details-collapsible.md
How to add a collapsible section in markdown.

A collapsible section with markdown

Click to expand!

Heading

  1. A numbered
  2. list
    • With some
    • Sub bullets
@GenevieveBuckley
GenevieveBuckley / .travis.yml
Last active March 14, 2019 23:55
Template for Travis CI integration using conda (remember to replace myenv)
language: python
python:
- "3.5"
- "3.6"
install:
- sudo apt-get update
- wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
- bash miniconda.sh -b -p $HOME/miniconda
- export PATH="$HOME/miniconda/bin:$PATH"
- hash -r
@GenevieveBuckley
GenevieveBuckley / environment.yml
Last active March 14, 2019 23:55
Template conda environment.yml file
name: envname
channels:
- defaults
- conda-forge
dependencies:
- python=3
- pytest
- pytest-cov
- pytest-flake8
- coveralls
@GenevieveBuckley
GenevieveBuckley / requirements.txt
Last active March 14, 2019 23:55
Template requirements.txt file
pytest
pytest-cov
pytest-flake8
coveralls
@GenevieveBuckley
GenevieveBuckley / user_input.py
Created March 15, 2019 00:59
User input in python using a while loop
response_yes = ['yes', 'y']
response_no = ['no', 'n']
response_cancel = ['quit', 'q', 'exit', 'cancel']
known_responses = response_yes + response_no + response_cancel
user_response = ''
while user_response.lower() not in known_responses:
user_response = input("Please input a value, or enter 'quit': ")
print(user_response)
@GenevieveBuckley
GenevieveBuckley / git-tag-delete-local-and-remote.sh
Created April 3, 2019 02:27 — forked from mobilemind/git-tag-delete-local-and-remote.sh
how to delete a git tag locally and remote
# 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
GenevieveBuckley / link_with_spaces.rst
Created April 3, 2019 23:55
Link with spaces in restructured text (.rst) files
@GenevieveBuckley
GenevieveBuckley / pytest.ini
Last active April 4, 2019 05:01
Pytest configuration file
[pytest]
addopts = --cov-report xml:cov.xml --cov-report term-missing --cov=mypackagename
@GenevieveBuckley
GenevieveBuckley / skimage_3d_compatibility.py
Last active April 16, 2019 12:47 — forked from emmanuelle/skimage_3d_compatibility.py
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
GenevieveBuckley / pytest-mpl.txt
Created April 30, 2019 06:57
Testing matplotlib image outputs with the pytest-mpl plugin
# To generate baseline images
py.test --mpl-generate-path=baseline
# To run pytest with the matplotlib plugin
py.test --mpl
# See full details here
# https://github.com/matplotlib/pytest-mpl