Skip to content

Commit 6441481

Browse files
authored
Add Attribute part table for Event
1 parent 1001a9d commit 6441481

File tree

3 files changed

+26
-3
lines changed

3 files changed

+26
-3
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
Observes [Semantic Versioning](https://semver.org/spec/v2.0.0.html) standard and [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) convention.
44

5+
## [0.2.4] - 2024-08-23
6+
7+
+ Update - EventType to varchar(32)
8+
+ Add - `Attribute` part-table for the `Event` table
9+
510
## [0.2.3] - 2023-06-20
611

712
+ Update - GitHub Actions workflows

element_event/event.py

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,12 @@ class EventType(dj.Lookup):
9393
"""Set of unique events present within a recording session
9494
9595
Attributes:
96-
event_type ( varchar(16) ): Unique event type.
96+
event_type ( varchar(32) ): Unique event type.
9797
event_type_description ( varchar(256) ): Event type description.
9898
"""
9999

100100
definition = """
101-
event_type : varchar(16)
101+
event_type : varchar(32)
102102
---
103103
event_type_description='' : varchar(256)
104104
"""
@@ -158,6 +158,24 @@ class Event(dj.Imported):
158158
event_end_time=null : float # (second) relative to recording start
159159
"""
160160

161+
class Attribute(dj.Part):
162+
"""Additional event attributes to fully describe an event
163+
164+
Attributes:
165+
Event (foreign key): Event table primary key.
166+
attribute_name ( varchar(32) ): Name of trial attribute
167+
attribute_value ( varchar(2000) ): Optional. Trial attribute value
168+
attribute_blob (longblob): Optional. Trial attribute numerical data
169+
"""
170+
171+
definition = """ # Additional event attributes to fully describe an event
172+
-> master
173+
attribute_name : varchar(32)
174+
---
175+
attribute_value='': varchar(2000)
176+
attribute_blob=null: longblob
177+
"""
178+
161179
def make(self, key):
162180
"""Populate based on unique entries in BehaviorRecording and EventType."""
163181
raise NotImplementedError("For `insert`, use `allow_direct_insert=True`")

element_event/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
"""Package metadata."""
2-
__version__ = "0.2.3"
2+
__version__ = "0.2.4"

0 commit comments

Comments
 (0)