bluesky / event-model

data model for event-based data collection and analysis
https://blueskyproject.io/event-model
BSD 3-Clause "New" or "Revised" License
15 stars 31 forks source link

Add 'value' property to projection schema on 'static' type #194

Open ronpandolfi opened 4 years ago

ronpandolfi commented 4 years ago

The projection schema is missing a 'value' property when using the 'static' type.

dylanmcreynolds commented 4 years ago

Do you have a use case for this? I think part of the reason I hadn't put this in initially is that I didn't really have one in mind.

Would you wnat a static type be available in any location (event, start, configuration)?

ronpandolfi commented 4 years ago

The static option is already in the schema, there's just no way to add a value. I know @tacaswell had some use cases in mind as well, but it makes sense as a trivial case when you want to add a value without having to extend the descriptor and insert it into an event.

I think the idea was more to include the value directly in the projection, something like:

{'name': 'intent',
 'version': '0.1.0',
 'projection':
     {f'intent_type': {'type': 'static',
                       'value': 'PlotIntent'},
      f'name': {'type': 'static',
                'value': 'q vs I'},...}}
dylanmcreynolds commented 4 years ago

Thanks. Would it be sufficient to define the value fields as a string in the schema?

ronpandolfi commented 4 years ago

I'd prefer it be Any. I have a few other types I'm already inserting here (dict, list).

dylanmcreynolds commented 4 years ago

Committed a fix into PR #192 . Will want something to support it in the databroker.projector