This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /// script | |
# requires-python = "==3.12" | |
# dependencies = [ | |
# "pymmcore-plus", | |
# "pymmcore-widgets", | |
# "ndv[vispy,pyqt]", | |
# ] | |
# /// | |
import numpy as np | |
from pymmcore_plus import CMMCorePlus |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /// script | |
# requires-python = ">=3.13" | |
# dependencies = [ | |
# "acquire-zarr", | |
# "zarr", | |
# "rich", | |
# "tensorstore", | |
# ] | |
# /// | |
#!/usr/bin/env python3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /// script | |
# requires-python = ">=3.13" | |
# dependencies = [ | |
# "pyqt6", | |
# ] | |
# /// | |
import sys | |
from PyQt6.QtWidgets import QApplication, QWidget, QLabel, QGridLayout | |
app = QApplication(sys.argv) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
from PyQt6.QtWidgets import QApplication, QWidget, QLabel, QGridLayout | |
app = QApplication(sys.argv) | |
widget = QWidget() | |
grid = QGridLayout() | |
text_label = QLabel() | |
text_label.setText("Hello World!") | |
grid.addWidget(text_label) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# %% | |
import numpy as np | |
# example of a 1-dimensional index: | |
N = 10 | |
index = np.logspace(0, 1, 10) # i.e. what would be a single coord in xarray | |
data = np.random.rand(N) | |
print(data) | |
print(index) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://bit.ly/4b9xkgI | |
# run with: | |
# powershell -Command "(New-Object Net.WebClient).DownloadString('https://bit.ly/4b9xkgI') | python" | |
# you may wish to change "python" to a specific version/env of python, e.g. | |
# powershell -Command "(New-Object Net.WebClient).DownloadString('https://bit.ly/4b9xkgI') | C:\Users\User\miniforge3\envs\mm\python.exe" | |
# or without powershell, if you have curl | |
# curl -L -o install_mm.py https://bit.ly/4b9xkgI && python install_mm.py && del install_mm.py | |
import urllib.request |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import math | |
import pint | |
AVOGADRO = pint.Quantity("6.02214076e23 /mol") | |
PLANCK = pint.Quantity("6.62607015e-34 J*s") | |
C = pint.Quantity("299792458 m/s") | |
def _ensure_quantity(value: str | float | pint.Quantity, units: str) -> pint.Quantity: | |
quant = pint.Quantity(value) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# output to the current directory if no argument is given | |
if [[ $# -eq 0 ]]; then | |
OUTPUT=$(pwd) | |
else | |
OUTPUT=$1 | |
fi | |
packages=("autoconf" "automake" "libtool" "boost") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from turtle import position | |
from typing import Sequence | |
import scipy.special | |
import numpy as np | |
from matplotlib import pyplot as plt | |
from matplotlib import patches | |
from matplotlib.animation import FuncAnimation | |
import warnings | |
from scipy.fft import fft, fftshift, ifftshift, fftfreq |
NewerOlder