From c0a9d5a0e4b8f335e261937005cea2cce6d7252d Mon Sep 17 00:00:00 2001 From: rly Date: Mon, 11 Nov 2024 23:50:44 -0800 Subject: [PATCH 1/2] Create Mermaid diagram --- README.md | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/README.md b/README.md index 0f571a0..cb23f38 100644 --- a/README.md +++ b/README.md @@ -74,6 +74,69 @@ generateExtension('/ndx-events/spec/ndx-events.namespace.yaml'); 1. [Example writing TTL pulses and stimulus presentations to an NWB file](examples/write_ttls_events.py). +## Diagram + + +```mermaid +%%{init: {'theme': 'base', 'themeVariables': {'primaryColor': '#ffffff', "primaryBorderColor': '#144E73', 'lineColor': '#D96F32'}}}%% + + +classDiagram + direction LR + + class TimestampVectorData { + <> + + data : NDArray[Shape["*"], Float] + --> unit : str = "seconds" + resolution : float, optional + } + + class DurationVectorData { + <> + + data : NDArray[Shape["*"], Float] + --> unit : str = "seconds" + resolution : float, optional + } + + class CategoricalVectorData { + <> + + data : NDArray[Shape["*"], Any] + meanings : MeaningsTable + filter_values : NDArray[Shape["*"], String], optional + } + + class MeaningsTable { + <> + + value : VectorData[NDArray[Shape["*"], Any]] + meaning : VectorData[NDArray[Shape["*"], String]] + } + + class EventsTable { + <> + + timestamp : TimestampVectorData + duration : DurationVectorData, optional + meanings_tables : list[MeaningsTable] + } + + class NdxEventsNWBFile { + <> + + events : list[EventsTable] + } + + CategoricalVectorData ..> MeaningsTable : object reference + EventsTable "1" *--> "0..*" MeaningsTable : contains + EventsTable "1" *--> "1..*" TimestampVectorData : contains + EventsTable "1" *--> "0..*" DurationVectorData : contains + EventsTable "1" *--> "0..*" CategoricalVectorData : contains + NdxEventsNWBFile "1" *--> "0..*" EventsTable : contains +``` + ## Developer installation In a Python 3.8-3.12 environment: From 34bff4bbec71a989405ae0373053faab62412292 Mon Sep 17 00:00:00 2001 From: Ryan Ly Date: Mon, 11 Nov 2024 23:52:51 -0800 Subject: [PATCH 2/2] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index cb23f38..8cecf65 100644 --- a/README.md +++ b/README.md @@ -121,6 +121,7 @@ classDiagram timestamp : TimestampVectorData duration : DurationVectorData, optional meanings_tables : list[MeaningsTable] + [additional_columns] : list[VectorData], optional } class NdxEventsNWBFile {