Skip to content

Instantly share code, notes, and snippets.

View danielballan's full-sized avatar

Dan Allan danielballan

View GitHub Profile
@danielballan
danielballan / databroker-migration-guide.md
Last active September 22, 2022 20:46
Databroker Migration Guide

Databroker Migration Guide

What?

This is a draft of a guide for migrating from Databroker v1.x to Databroker v2.x (currently in prerelease). The data storage does not change; only the way it is accessed changes. It is possible to run Databroker v1.x and 2.x against the same MongoDB concurrently. Databroker 1.x was effectively a plugin to Intake. Databroker 2.x refactors Databroker as a plugin to Tiled, and drops any depenedency on Intake.

@danielballan
danielballan / README.md
Last active June 9, 2022 18:32
FastAPI, Pydantic, and OpenAPI with recursive models
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@danielballan
danielballan / .flake8
Last active March 28, 2022 15:58
Store and search tomographic reconstructions with Tiled
[flake8]
max-line-length = 115
@danielballan
danielballan / example.md
Created February 17, 2022 22:29
FXI example data access

Example using public CC0-licensed FXI data

In this example, we connect to a public HTTP server and download raw tomography images.

It is not necessary to use Python to do this---curl would work fine---but the Tiled Python client is currently the most convenient way to do navigate the data.

pip install tiled[client]
@danielballan
danielballan / README.md
Created August 6, 2021 21:18
Bluesky Widgets Demo Quickstart

Bluesky Widgets Demo Quickstart

@danielballan
danielballan / README.md
Created July 17, 2021 18:09
MVP for Qt RemoteDispatcher

Terminal 1:

bluesky-0MQ-proxy 5567 5568

Terminal 2:

python publisher.py
@danielballan
danielballan / README.md
Last active February 24, 2021 17:03
IOC connection time analysis

IOC connection time analysis

We will use caproto-shark to analyze CA network traffic. Note that the actual servers and clients involve may or may not be using caproto themselves; it does not matter.

  1. Install caproto and pandas if they are not already installed.

    pip install caproto[standard] pandas
    
@danielballan
danielballan / logging-optimizations.md
Created January 28, 2021 16:47
Logging optimizations galaxy brain

Logging optimizations

We will examine the byte code to get a sense of how much work the interpreter is doing.

Setup

>>> import logging
>>> logger = logging.getLogger()
>>> from dis import dis