Skip to content

Instantly share code, notes, and snippets.

@flying-sheep
flying-sheep / pal2cmaps.ipynb
Last active August 20, 2025 08:48
Use colorspacious to make monochrome colormaps from palette colors
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Note

Title

Body

@flying-sheep
flying-sheep / hatch.toml
Created August 27, 2024 14:35
My scanpy hatch.toml
[metadata]
allow-direct-references = true
[envs.default]
installer = "uv"
#dependencies = ["ipykernel", "snakeviz", "py-spy", "ipywidgets", "ipynbname", "ipympl"]
features = ["dev"]
[envs.hatch-test]
default-args = []

MyST include reproducer

Run via something like

uv run conf.py

or

@flying-sheep
flying-sheep / find_subpackage.py
Last active August 13, 2024 17:39
Find subpackages of a namespace package in a distribution
import importlib
def find_subpackage(dist: str, ns_name: str):
"""Finds subpackages of a namespace package
Within a distribution `dist`, given a known toplevel namespace package `ns_name`,
this finds all 2 level deep package:
>>> list(find_subpackage("jaraco-classes", "jaraco"))
["jaraco.classes"]
@flying-sheep
flying-sheep / memray-flamegraph-anndata-mem.html
Created April 30, 2024 10:09
Flamegraph for anndata#1482
This file has been truncated, but you can view the full file.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>memray - flamegraph report</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css">
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.