Skip to content

Instantly share code, notes, and snippets.

Avatar

Dan Allan danielballan

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

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 Jun 9, 2022
FastAPI, Pydantic, and OpenAPI with recursive models
View README.md
View CHX image access.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View CHX image access.ipynb
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 Mar 28, 2022
Store and search tomographic reconstructions with Tiled
View .flake8
[flake8]
max-line-length = 115
@danielballan
danielballan / example.md
Created Feb 17, 2022
FXI example data access
View example.md

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 Aug 6, 2021
Bluesky Widgets Demo Quickstart
View README.md

Bluesky Widgets Demo Quickstart

@danielballan
danielballan / README.md
Created Jul 17, 2021
MVP for Qt RemoteDispatcher
View README.md

Terminal 1:

bluesky-0MQ-proxy 5567 5568

Terminal 2:

python publisher.py
@danielballan
danielballan / README.md
Last active Feb 24, 2021
IOC connection time analysis
View README.md

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 Jan 28, 2021
Logging optimizations galaxy brain
View logging-optimizations.md

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