Skip to content

Instantly share code, notes, and snippets.

View danielballan's full-sized avatar

Dan Allan danielballan

View GitHub Profile
@danielballan
danielballan / example.py
Last active May 18, 2023 20:01
Device with custom set
View example.py
from ophyd.sim import Signal
from ophyd import Component, Device
class Filters(Device):
a = Component(Signal, value=0)
b = Component(Signal, value=1)
def set(self, a, b):
return (
View README.md

Example of how to extend Tiled with a custom route

  1. Clone this gist and enter the directory.

  2. Install Tiled and and, optionally, a HTTP client to test with.

    pip install tiled[all] httpie
    
@danielballan
danielballan / README.md
Created March 10, 2023 15:21
Middle exploration
View README.md

Tasks

  1. Run python middlware.py.
  2. Using HTTPie, request data: http :8000/data. This should return the list of numbers from the server.
  3. Add a simple middleware that just uses print to print a message in the server logs before and after a request is seen.
  4. Add a second middleware that also prints.

Question: Do the middlewares get run in the order that they are added in middlware.py or in the reverse order?

View README.md
@danielballan
danielballan / README.md
Created November 21, 2022 14:45
Writing data into Tiled experimental sandbox
View README.md
conda activate sandbox
pip install --pre tiled[all] databroker[all] ipython

Note for Mac: Mac uses zsh by default and it requires single quotes like 'databroker[all]'. On the other hand, Windows requires that you not have quotes.

mkdir sandbox
cd sandbox/
View repo-review.md

Owners - Tech Steering Committee

Repos

area-detector-handlers

  • Dan Allan
  • Garrett Bischof
  • Maksim Rakitin
  • Jakob Wlodek
@danielballan
danielballan / databroker-migration-guide.md
Last active September 22, 2022 20:46
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 June 9, 2022 18:32
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.