Bluesky生态系统使用的数据模型
event-model的Python项目详细描述
事件模型
此存储库包含指定基于事件的架构的文档 NSLS-II使用的数据模型。组织中的其他项目使用此模型; 这是他们组织基于事件的数据的常用方法。
请参见this page of the NSLS-II documentation以获取图解 模型概述。
使用jsonschema指定文档。看这个 excellent tutorial 关于jsonschema的更多信息。
康达配方
安装最新的标记生成:conda install event-model -c lightsource2-tag
安装最新的标记生成:conda install event-model -c lightsource2-dev
用法
模式使用python api打包。(在未来,他们可能会 为其他语言打包。如果您对此感兴趣,请与我们联系。) 由于使用了新的枚举类型,此包需要Python3.4+。
公共api中有两个变量,一个名为DocumentNames
的枚举和
一个名为schemas
的字典,它的关键是
DocumentNames
。
In[1]:importevent_modelIn[2]:event_model.schemas[event_model.DocumentNames.event]Out[2]:{'additionalProperties':False,'description':'Document to record a quanta of collected data','properties':{'data':{'description':'The actual measument data','type':'object'},'descriptor':{'description':'UID to point back to Descriptor for this event stream','type':'string'},'seq_num':{'description':'Sequence number to identify the location of this Event in the Event stream','type':'integer'},'time':{'description':'The event time. This maybe different than the timestamps on each of the data entries','type':'number'},'timestamps':{'description':'The timestamps of the individual measument data','type':'object'},'uid':{'description':'Globally unique identifier for this Event','type':'string'}},'required':['uid','data','timestamps','time','descriptor','seq_num'],'title':'event','type':'object'}
与 jsonschema要验证的包 python中的文档。