Skip to content

Instantly share code, notes, and snippets.

View d-v-b's full-sized avatar
💭
status

Davis Bennett d-v-b

💭
status
  • Independent software engineer
  • Würzburg, Germany
  • 10:10 (UTC +02:00)
View GitHub Profile
@d-v-b
d-v-b / zarr_datetime_example.py
Created July 7, 2025 15:02
Create a Zarr V3 array with a datetime64 data type
# /// script
# dependencies = [
# "zarr@git+https://github.com/zarr-developers/zarr-python.git@main",
# ]
# ///
import numpy as np
import zarr
@d-v-b
d-v-b / demo.py
Last active June 19, 2025 15:17
pep-723 metadata + pytest for a simple self-contained parameterized code example
# /// script
# requires-python = ">=3.11"
# dependencies = [
# "pytest",
# ]
# ///
import pytest
import sys
@pytest.mark.parametrize('msg', ['hello world\n', 'hello again\n'])
def test(msg: str):
@d-v-b
d-v-b / demo.py
Created April 8, 2025 16:16
pep 723 + pytest demo
# /// script
# requires-python = ">=3.11"
# dependencies = [
# "pytest",
# ]
# ///
import pytest
@pytest.mark.parametrize('value', [0, 1, 2])
@d-v-b
d-v-b / create_sharded_array.py
Created January 16, 2025 10:32
zarr-python 3 array creation example
# /// script
# requires-python = ">=3.11"
# dependencies = [
# "zarr == 3.0.0",
# ]
# ///
from zarr import create_array
import numpy as np
@d-v-b
d-v-b / out.log
Created January 8, 2025 14:36
zarr 3 gcsfs log output
2025-01-08 15:34:58,955 - gcsfs - DEBUG - _call -- GET: https://storage.googleapis.com/download/storage/v1/b/gcp-public-data-arco-era5/o/ar%2Ffull_37-1h-0p25deg-chunk-1.zarr-v3%2Fzarr.json?alt=media, (), {}
2025-01-08 15:34:58,955 - gcsfs - DEBUG - _call -- GET: https://storage.googleapis.com/download/storage/v1/b/gcp-public-data-arco-era5/o/ar%2Ffull_37-1h-0p25deg-chunk-1.zarr-v3%2F.zgroup?alt=media, (), {}
2025-01-08 15:34:58,955 - gcsfs - DEBUG - _call -- GET: https://storage.googleapis.com/download/storage/v1/b/gcp-public-data-arco-era5/o/ar%2Ffull_37-1h-0p25deg-chunk-1.zarr-v3%2F.zattrs?alt=media, (), {}
2025-01-08 15:34:58,955 - gcsfs - DEBUG - _call -- GET: https://storage.googleapis.com/download/storage/v1/b/gcp-public-data-arco-era5/o/ar%2Ffull_37-1h-0p25deg-chunk-1.zarr-v3%2F.zmetadata?alt=media, (), {}
2025-01-08 15:34:59,751 - gcsfs - DEBUG - _call -- GET: b/{}/o, ('gcp-public-data-arco-era5',), None
2025-01-08 15:35:00,364 - gcsfs - DEBUG - _call -- GET: b/{}/o, ('gcp-public-data-arco-era5',), No
@d-v-b
d-v-b / panel_neuroglancer_demo.ipynb
Created December 17, 2024 13:46
demo of panel-neuroglancer
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@d-v-b
d-v-b / cached_array.py
Created December 17, 2024 11:07
A simple bounding-box-based array with caching
# /// script
# requires-python = ">=3.10"
# dependencies = [
# "numpy",
# ]
# ///
import numpy as np
from typing import Iterable
BBox = tuple[tuple[int, int], ...]
@d-v-b
d-v-b / cached_array.py
Created December 17, 2024 11:06
A simple bounding-box-based array with caching
# /// script
# requires-python = ">=3.10"
# dependencies = [
# "numpy",
# ]
# ///
import numpy as np
from typing import Iterable
BBox = tuple[tuple[int, int], ...]
@d-v-b
d-v-b / caddyfile
Last active August 9, 2024 16:49
neuroglancer-compatible caddyfile
{
debug
}
:8000 {
file_server {
browse
root /path/to/data
}
header {
Access-Control-Allow-Headers *
@d-v-b
d-v-b / dacapo_demo_data.py
Last active March 4, 2024 15:28
copy demo data from s3 for dacapo
from __future__ import annotations
from concurrent.futures import ThreadPoolExecutor, as_completed, wait
import os
import time
from typing import Any, Dict, List
import click
import numpy as np
import zarr
from zarr.storage import FSStore
import logging