Skip to content

Commit

Permalink
Merge pull request #40 from ttngu207/master
Browse files Browse the repository at this point in the history
Add `Attribute` part table for `Event`
  • Loading branch information
kushalbakshi authored Aug 23, 2024
2 parents 1001a9d + 4247f95 commit 0d2cbbf
Show file tree
Hide file tree
Showing 3 changed files with 27 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
3 changes: 2 additions & 1 deletion element_event/version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
"""Package metadata."""
__version__ = "0.2.3"

__version__ = "0.2.4"

0 comments on commit 0d2cbbf

Please sign in to comment.