Code Monkey home page Code Monkey logo

event-model's Introduction

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.

event-model's People

Contributors

danielballan avatar tacaswell avatar mrakitin avatar awalter-bnl avatar ericdill avatar arkilic avatar jorgediazjr avatar licode avatar ke-zhang-rd avatar jrmlhermitte avatar stuartcampbell avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.