Closed evalott100 closed 1 year ago
@coretl Refactored and added comments, ready for another review!
"definitions": {
"Calculation": {
"title": "Calculation",
"type": "object",
"properties": {
"args": {
"title": "Args",
"type": "array",
"items": {}
},
"properties": {
"configuration": {
"title": "Configuration",
"description": "Static information about projection",
"type": "object"
},
$ref
is used there is always an allOf
block. This doesn't matter since there is only one $ref
inside (pydantic forces this behaviour). "allOf": [
{
"$ref": "#/definitions/Dataframe"
}
]
},
"type": "array"
keys where datatype isn't specified now have
"type": "array",
"items": {}`
datum_page.json
has changed from title: "datum"
to title: "datum_page"
. "Dataframe": {
"title": "Dataframe",
"type": "array",
"items": {
"type": "string"
}
datum_id
is now a Dataframe
(still an array of strings). datum_kwargs
is now an array, string, bool, or number:
https://github.com/evalott100/event-model/blob/e91f648dc74c294a97ceac497f25cb6d6d193d87/event_model/schemas/datum_page.json#L24-L41 "datum_kwargs": {
"title": "Datum Kwargs",
"description": "Array of arguments to pass to the Handler to retrieve one quanta of data",
"type": "object",
"additionalProperties": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "string"
},
{
"type": "number"
},
{
"type": "array",
"items": {}
}
]
}
},
resource
is not NotRequired
https://github.com/evalott100/event-model/blob/e91f648dc74c294a97ceac497f25cb6d6d193d87/event_model/schemas/datum_page.json#L52-L55
"required": [
"datum_id",
"resource"
],
filled
is now of type
"type": "object",
"additionalProperties": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "string"
}
]
}
},
instead of type
"type": [
"boolean",
"string"
]
"precision": {
"title": "Precision",
"description": "Number of digits after decimal place if a floating point number",
"type": "integer"
},
and units
"units": {
"title": "Units",
"description": "Engineering units of the value",
"type": "string"
}
DataframeForFilled
now has
"anyOf": [
{
"type": "boolean"
},
{
"type": "string"
}
]
instead of
"type": "array",
"items": {
"type": [
"boolean",
"string"
]
"definitions": {
"Calculation": {
"title": "Calculation",
"type": "object",
"properties": {
"args": {
"title": "Args",
"type": "array",
"items": {}
},
projection no longer has a superfluous "."
in pattern properties
"patternProperties": {
".": {
"$ref": "#/definitions/projection"
}
is now
"additionalProperties": {
"$ref": "#/definitions/Projection"
}
Hints now has its own reference https://github.com/evalott100/event-model/blob/e91f648dc74c294a97ceac497f25cb6d6d193d87/event_model/schemas/run_start.json#L33
sample is now of type
"anyOf": [
{
"type": "object"
},
{
"type": "string"
}
instead of type
"type": [
"object",
"string"
]
data_type
no longer has unnecessary second "^([^./]+)$"
pattern property, it's already done here
"patternProperties": {
"^([^./]+)$": {
"$ref": "#/definitions/DataType"
}
Blank "properties": {},
removed from num_events
https://github.com/evalott100/event-model/blob/e91f648dc74c294a97ceac497f25cb6d6d193d87/event_model/schemas/run_stop.json#L30-L36
Closes #235
Adds TypedDicts and code to generate schemas from TypedDicts. It's necessary to merge #245 prior to this so black formatting doesn't cause problems.