This file contains hidden or 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
| #!/usr/bin/env python3 | |
| """ | |
| Make a `zpool create ...` command for a set of identical disks, | |
| calculating vdev size etc. from the given configuration. | |
| You will need to know the disk model name; | |
| you should be able to identify it from the output of | |
| `lsblk -d -e 7 -o NAME,SIZE,STATE,MODEL`. | |
| """ | |
| import getpass | |
| from argparse import ArgumentParser |
This file contains hidden or 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 os | |
| import shutil | |
| from pathlib import Path | |
| import navis | |
| import numpy as np | |
| from scipy.ndimage import binary_fill_holes | |
| # in nm, for converting world coords to voxel indices | |
| resolution = np.array([3.8, 3.8, 50]) |
This file contains hidden or 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
| #!/usr/bin/env python | |
| """ | |
| Script for (somewhat safely) adding metadata required by BigDataViewer | |
| (and optionally n5-viewer) to multiscale datasets stored in N5 containers. | |
| """ | |
| from dataclasses import dataclass | |
| import json | |
| from pathlib import Path | |
| from argparse import ArgumentParser | |
| import re |
This file contains hidden or 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
| #!/usr/bin/env python | |
| """ | |
| Script for taking results from matches and applying a trueskill-esque rating system. | |
| Results can either be returned as rankings, or as a plot of probability distributions of ratings. | |
| The input is a columnar TSV. | |
| In each column, the cells are: ISO-8601 datetime of the match, one team's score, and | |
| then the team's members (one per cell) in arbitrary order. | |
| Therefore, there are 2 columns per match, which share a datetime not shared by any other | |
| matches. |
This file contains hidden or 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
| #!/usr/bin/env python | |
| from argparse import ArgumentParser | |
| import datetime as dt | |
| from typing import Iterable, List | |
| from _strptime import TimeRE | |
| import re | |
| import sys | |
| import logging | |
| from dataclasses import dataclass | |
| from collections import defaultdict |
This file contains hidden or 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.units = [ | |
| { | |
| name: "PNs", | |
| color: "#000000", | |
| // PN KC MBON latMBON FBN FB2IN MBIN | |
| w: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], | |
| k: 1.5, | |
| th: 5.0, | |
| I_tonic: 0, | |
| I_stim: 10.0, |
This file contains hidden or 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
| """Configuration for in-package doctests. | |
| Should be importable (but not useful) | |
| without development dependencies. | |
| Where these files up and when they are deleted is documented | |
| `here <https://pytest.org/en/stable/tmpdir.html#the-default-base-temporary-directory>`_. | |
| """ | |
| from pathlib import Path |
This file contains hidden or 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
| """ | |
| Qt's QSpinBox is backed by an i32, which sometimes isn't big enough. | |
| This class gives you a much larger range by subclassing QDoubleSpinBox, | |
| and taking a numpy dtype for what kind of int you want it to represent. | |
| This can represent integers from -2**53 to 2**53, | |
| and warns for values it cannot represent, | |
| which gives a bit more headroom where large integers are required. | |
| Originally implemented [1] for napari [2]. |
This file contains hidden or 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
| backports.strenum | |
| molesq | |
| hcl | |
| yarqueue | |
| #extra: ncollpyde | |
| ncollpyde | |
| #extra: test |
This file contains hidden or 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 pytest | |
| class ParameterBuilder: | |
| def __init__(self, argnames, indirect=False, id_fn=None, scope=None): | |
| if isinstance(argnames, str): | |
| argnames = [s.strip() for s in argnames.split(",")] | |
| self.argnames = argnames | |
| self.indirect = indirect | |
| self.id_fn = id_fn |