BCDA-APS / use_bluesky

Tools to help APS use the Bluesky Framework (https://blueskyproject.io/)
8 stars 3 forks source link

cannot count yet, plan fails on "filled" #22

Closed prjemian closed 6 years ago

prjemian commented 6 years ago

Something wrong with the setup still. Perhaps with the metadatabroker?

In [3]: RE(bp.count([noisy]))
 ...
~/Apps/BlueSky/lib/python3.6/site-packages/metadatastore/mds.py in insert(self, name, doc)
    717     def insert(self, name, doc):
    718         if name != 'bulk_events':
--> 719             getattr(self, self._INS_METHODS[name])(**doc)
    720         else:
    721             for desc_uid, events in doc.items():

TypeError: insert_event() got an unexpected keyword argument 'filled'
prjemian commented 6 years ago

Turns out that metadatastore and filestore modules have been deprecated. The database setup is relocated in ~/.config/databroker/*.yml files.

Such as ~/.config/databroker/mongodb_config.yml:

description: 'heavyweight shared database'
metadatastore:
    module: 'databroker.headersource.mongo'
    class: 'MDS'
    config:
        host: 'otz.aps.anl.gov'
        port: 27017
        database: 'metadatastore-production-v1'
        timezone: 'US/Central'
assets:
    module: 'databroker.assets.mongo'
    class: 'Registry'
    config:
        host: 'otz.aps.anl.gov'
        port: 27017
        database: 'filestore-production-v1'

This is then called from 01-databroker.py like:

from databroker import Broker
db = Broker.named("mongodb_config")
RE = bluesky.RunEngine()
prjemian commented 6 years ago

The YAML file will need additional setup lines in the bash script.

prjemian commented 6 years ago

NSLS-II recent hints for ipython setup "best practices": https://github.com/NSLS-II/nsls-ii-tools/blob/master/nsls2tools/csx1/startup/startup.py