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 / illumination_correction.py
Last active November 2, 2018 02:25 — forked from DragaDoncila/file_processes.py
microscopium illumination correction script
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 October 12, 2018 05:17
Logging in python - setting up output to file and terminal simultaneously
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 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 / .travis.yml
Created September 24, 2018 06:00
Template for Travis CI integration
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 March 14, 2019 23:55
Template requirements.txt file
pytest
pytest-cov
pytest-flake8
coveralls
@GenevieveBuckley
GenevieveBuckley / setup.cfg
Created September 24, 2018 05:29 — forked from althonos/setup.cfg
A `setup.cfg` template for my Python projects
# https://gist.github.com/althonos/6914b896789d3f2078d1e6237642c35c
[metadata]
name = {name}
version = {version}
author = Martin Larralde
author-email = [email protected]
home-page = https://github.com/althonos/{name}
description = {description}
long-description = file: README.rst, CHANGELOG.rst
@GenevieveBuckley
GenevieveBuckley / drift_correct
Last active September 11, 2018 23:56
First attempt at a drift correction function for scikit-image
def drift_correct(image, shifts, shift_axes=[], kwargs*):
"""Align image array to correct for motion over time.
Parameters
----------
image : ndarray
Image to drift correct.
shifts : ndarray
Amount to shift each image at each timepoint.
Returned from skimage.feature.register_translation()
@GenevieveBuckley
GenevieveBuckley / pr.md
Created August 10, 2018 01:43 — forked from piscisaureus/pr.md
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = [email protected]:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@GenevieveBuckley
GenevieveBuckley / imread
Created August 8, 2018 00:20 — forked from charlesreid1/imread
Results from using different imread() functions
In [1]: from skimage.io import imread as skimage_imread
In [2]: from matplotlib.pyplot import imread as plt_imread
In [3]: from scipy.ndimage import imread as scipy_imread
In [4]: skimage_imread('bulk_water_000.png')
Out[4]:
array([[[146, 125, 54, 255],
[146, 125, 54, 255],
@GenevieveBuckley
GenevieveBuckley / gui_automation_python.md
Last active August 8, 2018 00:16 — forked from diyan/gui_automation_python.md
Desktop GUI automation in Python

Desktop

UI Automation. Desktop. Python

GUI toolkit agnostic

autopy - simple, cross-platform GUI automation toolkit. MIT - https://github.com/autopilot-rs/autopy

  • GUI toolkit agnostic
  • allows you to move mouse, take screenshots, show alerts, search for bitmaps on-screen