Skip to content

Instantly share code, notes, and snippets.

Genevieve Buckley GenevieveBuckley

  • Monash University
  • Melbourne
View GitHub Profile
@GenevieveBuckley
GenevieveBuckley / ..git-pr.md
Created Nov 19, 2018 — forked from gnarf/..git-pr.md
git pr - Global .gitconfig aliases for Pull Request Managment
View ..git-pr.md

Install

Either copy the aliases from the .gitconfig or run the commands in add-pr-alias.sh

Usage

Easily checkout local copies of pull requests from remotes:

  • git pr 4 - creates local branch pr/4 from the github upstream(if it exists) or origin remote and checks it out
  • git pr 4 someremote - creates local branch pr/4 from someremote remote and checks it out
View bokeh_jupyter_notebook.py
from bokeh.io import push_notebook, output_notebook, show, save
from bokeh.layouts import row, column, layout
from bokeh.plotting import figure
output_notebook()
@GenevieveBuckley
GenevieveBuckley / python_testing.md
Last active Nov 13, 2018
Python testing and coverage reports with pytest and pytest-cov
View python_testing.md

Python testing

pytest

https://docs.pytest.org/en/latest/usage.html

pytest
pytest path/to/tests/
pytest path/to/tests/test_file.py
pytest path/to/tests/test_file.py::test_func
pytest path/to/tests/test_file.py::TestClass
@GenevieveBuckley
GenevieveBuckley / checkout_pull_request_locally.md
Created Nov 13, 2018
Checkout a git pull request locally
View checkout_pull_request_locally.md
@GenevieveBuckley
GenevieveBuckley / .travis.yml
Last active Mar 14, 2019
Template for Travis CI integration using conda (remember to replace myenv)
View .travis.yml
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 / illumination_correction.py
Last active Nov 2, 2018 — forked from DragaDoncila/file_processes.py
microscopium illumination correction script
View illumination_correction.py
import os
import re
from microscopium import io
from microscopium.preprocess import correct_multiimage_illumination
from microscopium.preprocess import find_background_illumination
def main():
IMAGE_FILE_PATH = "/data/"
@GenevieveBuckley
GenevieveBuckley / logging.py
Created Oct 12, 2018
Logging in python - setting up output to file and terminal simultaneously
View logging.py
import time
import logging
# See the docs: https://docs.python.org/3/library/logging.html
timestamp = time.strftime('%d-%b-%Y_%H-%M%p', time.localtime())
log_filename = "path/to/log.txt"
logging.basicConfig(
format="%(asctime)s %(message)s",
level=logging.DEBUG,
@GenevieveBuckley
GenevieveBuckley / environment.yml
Last active Mar 14, 2019
Template conda environment.yml file
View environment.yml
name: envname
channels:
- defaults
- conda-forge
dependencies:
- python=3
- pytest
- pytest-cov
- pytest-flake8
- coveralls
@GenevieveBuckley
GenevieveBuckley / .travis.yml
Created Sep 24, 2018
Template for Travis CI integration
View .travis.yml
language: python
python:
- "2.7"
- "3.4"
- "3.5"
- "3.6"
- "3.7"
before_install:
- pip install -r requirements.txt
install:
@GenevieveBuckley
GenevieveBuckley / requirements.txt
Last active Mar 14, 2019
Template requirements.txt file
View requirements.txt
pytest
pytest-cov
pytest-flake8
coveralls
You can’t perform that action at this time.