diff --git a/docs/developer/explanations/decisions/0003-exposed-documents-on-event_model.rst b/docs/developer/explanations/decisions/0003-exposed-documents-on-event_model.rst new file mode 100644 index 000000000..73b564e28 --- /dev/null +++ b/docs/developer/explanations/decisions/0003-exposed-documents-on-event_model.rst @@ -0,0 +1,24 @@ +3. Made all documents accessible from the top level namespace +============================================================= + +Date: 2024-10-03 + +Status +------ + +Accepted + +Context +------- + +We should make all documents importable from the top level event-model namespace. We should be able to `from event_model import Limits` rather than `from event_model.documents import Limits` or `from event_model.documents.event_descriptor import Limits`. + + +Decision +-------- + +Accepted + +Consequences +------------ +Repositories downstream will be able to simplify their imports. \ No newline at end of file diff --git a/docs/user/reference/release-history.rst b/docs/user/reference/release-history.rst index 328368f3e..d4a854947 100644 --- a/docs/user/reference/release-history.rst +++ b/docs/user/reference/release-history.rst @@ -2,6 +2,18 @@ Release History *************** +v1.22.0 (2024-10-02) +==================== + +Changed +------- +* Added a `NX_class` field as a `PerObjectHint` to the `EventDescriptor` document. +* Removed `Optional` on `DataKey` fields `precision`, ``choices``, and `units`. These fields can still be left out of the `DataKey`, but if provided they cannot be `None`. +* Added a `Limits` type for storing EPICS limit data and a `NotRequired[Limits]` `limits` field to `DataKey`. +* Added a `NotRequired` `dtype_numpy` field to `DataKey` for specifying the numpy dtype of data. +* Bumped from `jsonschema 3.*` to `jsonschema 4.*`. +* Added all documents to `event_model` namespace. + v1.21.0 (2024-05-21) ==================== diff --git a/event_model/__init__.py b/event_model/__init__.py index 784e33eef..ac3c466aa 100644 --- a/event_model/__init__.py +++ b/event_model/__init__.py @@ -34,19 +34,21 @@ import numpy from typing_extensions import Literal -from .documents import Dtype from .documents.datum import Datum from .documents.datum_page import DatumPage -from .documents.event import Event +from .documents.event import Event, PartialEvent from .documents.event_descriptor import ( Configuration, DataKey, + Dtype, EventDescriptor, + Limits, + LimitsRange, PerObjectHint, ) -from .documents.event_page import EventPage -from .documents.resource import Resource -from .documents.run_start import RunStart +from .documents.event_page import EventPage, PartialEventPage +from .documents.resource import PartialResource, Resource +from .documents.run_start import Calculation, Hints, Projection, Projections, RunStart from .documents.run_stop import RunStop from .documents.stream_datum import StreamDatum, StreamRange from .documents.stream_resource import StreamResource @@ -62,7 +64,32 @@ __all__ = [ + # Document types + "Datum", + "DatumPage", + "Event", + "PartialEvent", + "Configuration", + "DataKey", "Dtype", + "EventDescriptor", + "Limits", + "LimitsRange", + "PerObjectHint", + "EventPage", + "PartialEventPage", + "PartialResource", + "Resource", + "Calculation", + "Hints", + "Projection", + "Projections", + "RunStart", + "RunStop", + "StreamDatum", + "StreamRange", + "StreamResource", + # Schema and version "DocumentNames", "schemas", "schema_validators",