Skip to content

Instantly share code, notes, and snippets.

View GenevieveBuckley's full-sized avatar

Genevieve Buckley GenevieveBuckley

  • Monash University
  • Melbourne
View GitHub Profile
import pandas as pd
import os
import re
from sklearn.decomposition import PCA
from microscopium import io
from microscopium.preprocess import montage_stream
from microscopium.preprocess import correct_multiimage_illumination
from microscopium.preprocess import find_background_illumination
@rainwoodman
rainwoodman / dask-cluster.sh
Last active April 1, 2021 04:22
Launch a transient dask cluster (scheduler + workers) for a client in a SLURM job
OPTS=`getopt -o p:P:T:M:s:m:h --long port:nprocs:,nthreads:,memory-limit:,socks:,monitor:,help -- "$@"`
usage () {
echo "usage : bash dask-cluster.sh -M memory-limit -P nprocs -T nthreads -s SOCKSPORT -m MONITORHOST -p MONITORPORT [ clientcommand ... ] "
echo
echo launch a transient dask cluster via SLURM. The purpose of the cluster is to run a single dask
echo client.
echo
echo The script will setup a SOCKS proxy at localhost:SOCKSPORT on MONITORHOST to access the cluster.
echo via the ssh service at MONITORHOST:MONITORPORT
@acbetter
acbetter / QImageViewer.py
Last active June 30, 2024 20:06
Image Viewer Example by PyQt5 and Python 3
#!/usr/bin/python3
# -*- coding: utf-8 -*-
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QImage, QPixmap, QPalette, QPainter
from PyQt5.QtPrintSupport import QPrintDialog, QPrinter
from PyQt5.QtWidgets import QLabel, QSizePolicy, QScrollArea, QMessageBox, QMainWindow, QMenu, QAction, \
qApp, QFileDialog
@martindurant
martindurant / bokeh_tricks.py
Created May 23, 2018 16:31
interactive image
import bokeh
from bokeh.io import output_notebook, push_notebook
output_notebook()
##
import numpy as np
from ipywidgets import interact, widgets
from bokeh.plotting import figure, show
@ctmakro
ctmakro / ipython_display.py
Last active April 15, 2024 03:22
Display numpy ndarray as Image in Jupyter/IPython notebook
# if input image is in range 0..1, please first multiply img by 255
# assume image is ndarray of shape [height, width, channels] where channels can be 1, 3 or 4
def imshow(img):
import cv2
import IPython
_,ret = cv2.imencode('.jpg', img)
i = IPython.display.Image(data=ret)
IPython.display.display(i)
@althonos
althonos / setup.cfg
Last active March 4, 2024 18:08
A `setup.cfg` template for my Python projects
# https://gist.github.com/althonos/6914b896789d3f2078d1e6237642c35c
[metadata]
name = {name}
version = file: {name}/_version.txt
author = Martin Larralde
author_email = [email protected]
url = https://github.com/althonos/{name}
description = {description}
long_description = file: README.md
@kb1lqc
kb1lqc / test_serial.py
Created February 12, 2018 03:54
Unit Testing Serial Ports | Serial Port Unit Tests
import pytest
import sliplib
import string
from faradayio import faraday
from tests.serialtestclass import SerialTestClass
def test_socketOne():
"""Simple test to make sure loopback serial port created successfully"""
@charlesreid1
charlesreid1 / imread
Created November 9, 2017 21:15
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],
@andreasonny83
andreasonny83 / .gitignore
Last active April 26, 2025 07:12
Gitignore template for JavaScript projects
# See http://help.github.com/ignore-files/ for more about ignoring files.
# compiled output
/dist
/tmp
/out-tsc
# Runtime data
pids
*.pid
@pierrejoubert73
pierrejoubert73 / markdown-details-collapsible.md
Last active May 7, 2025 20:12
How to add a collapsible section in markdown.

How to add a collapsible section in markdown

1. Example

Click me

Heading

  1. Foo
  2. Bar
    • Baz
  • Qux