Skip to content

Commit

Permalink
changed jsonschema directory name back
Browse files Browse the repository at this point in the history
  • Loading branch information
evalott100 committed Dec 19, 2024
1 parent de897d0 commit 3e827a2
Show file tree
Hide file tree
Showing 20 changed files with 31 additions and 31 deletions.
24 changes: 12 additions & 12 deletions src/event_model/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1825,18 +1825,18 @@ class MismatchedDataKeys(InvalidData):

SCHEMA_PATH = "schemas"
SCHEMA_NAMES = {
DocumentNames.start: "jsonschemas/run_start.json",
DocumentNames.stop: "jsonschemas/run_stop.json",
DocumentNames.event: "jsonschemas/event.json",
DocumentNames.event_page: "jsonschemas/event_page.json",
DocumentNames.descriptor: "jsonschemas/event_descriptor.json",
DocumentNames.datum: "jsonschemas/datum.json",
DocumentNames.datum_page: "jsonschemas/datum_page.json",
DocumentNames.resource: "jsonschemas/resource.json",
DocumentNames.stream_datum: "jsonschemas/stream_datum.json",
DocumentNames.stream_resource: "jsonschemas/stream_resource.json",
DocumentNames.bulk_datum: "jsonschemas/bulk_datum.json",
DocumentNames.bulk_events: "jsonschemas/bulk_events.json",
DocumentNames.start: "schemas/run_start.json",
DocumentNames.stop: "schemas/run_stop.json",
DocumentNames.event: "schemas/event.json",
DocumentNames.event_page: "schemas/event_page.json",
DocumentNames.descriptor: "schemas/event_descriptor.json",
DocumentNames.datum: "schemas/datum.json",
DocumentNames.datum_page: "schemas/datum_page.json",
DocumentNames.resource: "schemas/resource.json",
DocumentNames.stream_datum: "schemas/stream_datum.json",
DocumentNames.stream_resource: "schemas/stream_resource.json",
DocumentNames.bulk_datum: "schemas/bulk_datum.json",
DocumentNames.bulk_events: "schemas/bulk_events.json",
}
schemas = {}
for name, filename in SCHEMA_NAMES.items():
Expand Down
2 changes: 1 addition & 1 deletion src/event_model/documents/event_descriptor.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class DataKey(TypedDict):
"""
The names for dimensions of the data. Null or empty list if scalar data
"""
dtype: Literal['string', 'number', 'array', 'boolean', 'integer']
dtype: Literal["string", "number", "array", "boolean", "integer"]
"""
The type of the data in the event, given as a broad JSON schema type.
"""
Expand Down
2 changes: 1 addition & 1 deletion src/event_model/documents/resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class Resource(TypedDict):
externally-stored data
"""

path_semantics: NotRequired[Optional[Literal['posix', 'windows']]]
path_semantics: NotRequired[Optional[Literal["posix", "windows"]]]
"""
Rules for joining paths
"""
Expand Down
2 changes: 1 addition & 1 deletion src/event_model/documents/run_stop.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class RunStop(TypedDict):
"""
data_type
"""
exit_status: Literal['success', 'abort', 'fail']
exit_status: Literal["success", "abort", "fail"]
"""
State of the run when it ended
"""
Expand Down
6 changes: 3 additions & 3 deletions src/event_model/generate/create_documents.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

from event_model.basemodels import ALL_BASEMODELS

JSONSCHEMA = Path(__file__).parent.parent / "jsonschemas"
JSONSCHEMA = Path(__file__).parent.parent / "schemas"
DOCUMENTS = Path(__file__).parent.parent / "documents"


Expand Down Expand Up @@ -85,6 +85,7 @@ def dump_json(schema: Dict[str, Any], jsonschema_path: Path):
sorted_schema = sort_schema(schema)
with jsonschema_path.open(mode="w") as f:
json.dump(sorted_schema, f, indent=4)
f.write("\n")
return True


Expand Down Expand Up @@ -114,7 +115,6 @@ def jsonschema_differs_from_saved(
"""

if not jsonschema_path.exists():
print("+++++++++++++++ PATH DOESN@T EXIST", jsonschema_path)
return True

with jsonschema_path.open("r") as file:
Expand Down Expand Up @@ -193,7 +193,7 @@ def generate_jsonschema(
ignore_schema=schema_extra,
):
print(f"Detected change in {basemodel}, updating schema.")
# Dump with the extra schema that we want to leave out of
# Dump without the extra schema that we want to leave out of
# the TypedDict conversion
dump_json(model_jsonschema, jsonschema_path=jsonschema_path)
generate_typeddict(jsonschema_path, documents_path=documents_parent_path)
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@
"resource"
],
"additionalProperties": false
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@
"resource"
],
"additionalProperties": false
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,4 @@
"uid"
],
"additionalProperties": false
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -454,4 +454,4 @@
}
},
"additionalProperties": false
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,4 @@
"uid"
],
"additionalProperties": false
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@
"timestamps"
],
"additionalProperties": false
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,4 @@
"timestamps"
],
"additionalProperties": false
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@
"uid"
],
"additionalProperties": false
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,4 @@
"uid"
],
"additionalProperties": false
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -444,4 +444,4 @@
}
},
"additionalProperties": false
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,4 @@
}
},
"additionalProperties": false
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@
"stream_resource",
"uid"
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@
"uid",
"uri"
]
}
}

0 comments on commit 3e827a2

Please sign in to comment.