tutorials icon indicating copy to clipboard operation
tutorials copied to clipboard

'CatalogOfBlueskyRuns' object has no attribute 'register_handler'

Open burkeds opened this issue 3 years ago • 1 comments

I am trying to follow along with the tutorial section "Array Detector (non-EPICS)" (https://blueskyproject.io/tutorials/Ophyd/04%20-%20Array%20Detector.html).

I am not able to complete the RunEngine section of the tutorial with databroker version '2.0.0b10'

I run this cell in Jupyter

from bluesky import RunEngine
from databroker.v2 import temp

RE = RunEngine()
db = temp()
RE.subscribe(db.v1.insert)

db.register_handler("MY_FORMAT_SPEC", MyHandler)

This returns the following error: AttributeError: 'CatalogOfBlueskyRuns' object has no attribute 'register_handler'

If I comment out this line, I get the following error when I try to read from the db: UndefinedAssetSpecification: "Resource document with uid 190a2f02-c27a-441d-98fc-90064f1799ed refers to spec 'MY_FORMAT_SPEC' which is not defined in the Filler's handler registry."

burkeds avatar Oct 25 '22 15:10 burkeds

Databroker 2.x makes some massive changes, reworking Databroker from a "thick" Python library to a server--client architecture that runs over HTTP.

Most user code is backward-compatible but some aspects (like this one) cannot be done the same way in a server--client architecture. I suggest trying 1.x for now. Once 2.x is released (currently in beta) we'll update the tutorial materials.

danielballan avatar Oct 31 '22 16:10 danielballan