Skip to content

Commit

Permalink
Add Attribute part table for Event
Browse files Browse the repository at this point in the history
  • Loading branch information
ttngu207 authored Aug 23, 2024
1 parent 1001a9d commit 6441481
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

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

## [0.2.4] - 2024-08-23

+ Update - EventType to varchar(32)
+ Add - `Attribute` part-table for the `Event` table

## [0.2.3] - 2023-06-20

+ Update - GitHub Actions workflows
Expand Down
22 changes: 20 additions & 2 deletions element_event/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,12 @@ class EventType(dj.Lookup):
"""Set of unique events present within a recording session
Attributes:
event_type ( varchar(16) ): Unique event type.
event_type ( varchar(32) ): Unique event type.
event_type_description ( varchar(256) ): Event type description.
"""

definition = """
event_type : varchar(16)
event_type : varchar(32)
---
event_type_description='' : varchar(256)
"""
Expand Down Expand Up @@ -158,6 +158,24 @@ class Event(dj.Imported):
event_end_time=null : float # (second) relative to recording start
"""

class Attribute(dj.Part):
"""Additional event attributes to fully describe an event
Attributes:
Event (foreign key): Event table primary key.
attribute_name ( varchar(32) ): Name of trial attribute
attribute_value ( varchar(2000) ): Optional. Trial attribute value
attribute_blob (longblob): Optional. Trial attribute numerical data
"""

definition = """ # Additional event attributes to fully describe an event
-> master
attribute_name : varchar(32)
---
attribute_value='': varchar(2000)
attribute_blob=null: longblob
"""

def make(self, key):
"""Populate based on unique entries in BehaviorRecording and EventType."""
raise NotImplementedError("For `insert`, use `allow_direct_insert=True`")
Expand Down
2 changes: 1 addition & 1 deletion element_event/version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
"""Package metadata."""
__version__ = "0.2.3"
__version__ = "0.2.4"

0 comments on commit 6441481

Please sign in to comment.