Skip to main content

Data model used by the bluesky ecosystem

Project description

Event Model

This repository contains documents that specify the schema for an event-based data model used at NSLS-II. Other projects in the organization use this model; it is their common way of organizing event-based data.

See this page of the NSLS-II documentation for an illustrated overview of the model.

The documents are specified using jsonschema. See this excellent tutorial for more on jsonschema.

Conda Recipes

Install the most recent tagged build: conda install event-model -c lightsource2-tag

Install the most recent tagged build: conda install event-model -c lightsource2-dev

Find the tagged recipe here and the dev recipe here

Usage

The schemas are packaged with a Python API. (In the future, they will probably be packaged for other languages. Get in touch if you are interested in this.) Because of its use of the new Enum type, this package requires Python 3.4+.

There are two variables in the public API, an Enum called DocumentNames and a dictionary called schemas that is keyed on the values of DocumentNames.

In [1]: import event_model

In [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'}

Use it in conjunction with the jsonschema package to validate documents in Python.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

event-model-1.15.2.tar.gz (66.9 kB view details)

Uploaded Source

Built Distribution

event_model-1.15.2-py3-none-any.whl (37.5 kB view details)

Uploaded Python 3

File details

Details for the file event-model-1.15.2.tar.gz.

File metadata

  • Download URL: event-model-1.15.2.tar.gz
  • Upload date:
  • Size: 66.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/42.0.2.post20191203 requests-toolbelt/0.9.1 tqdm/4.40.2 CPython/3.7.5

File hashes

Hashes for event-model-1.15.2.tar.gz
Algorithm Hash digest
SHA256 31b6103801abcc3ebe099757bca7c9da9b4d535330acf0ba10d81c0753eb0e51
MD5 c25d21f068354b54b11ae6b539a36ab6
BLAKE2b-256 1b11b273d394bcf5e3f949be73db1416be95cf2277e7a19da74081d6f68ffa89

See more details on using hashes here.

File details

Details for the file event_model-1.15.2-py3-none-any.whl.

File metadata

  • Download URL: event_model-1.15.2-py3-none-any.whl
  • Upload date:
  • Size: 37.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/42.0.2.post20191203 requests-toolbelt/0.9.1 tqdm/4.40.2 CPython/3.7.5

File hashes

Hashes for event_model-1.15.2-py3-none-any.whl
Algorithm Hash digest
SHA256 96b695bcd1a8ec32004e69aa364e93e83976443eeb6c4d4adcc0fea0af0389b5
MD5 882e6da3a9ecfdd0b02f002ff7f48e41
BLAKE2b-256 eff475c587d7cbcac5efe5099a44a6de266b40222fe4cf7c61e16dc0684f72bb

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page