Skip to content

Commit

Permalink
Merge pull request #36 from kushalbakshi/main
Browse files Browse the repository at this point in the history
Add `BehaviorTimeSeries` manual table
  • Loading branch information
Thinh Nguyen authored Jan 5, 2024
2 parents 2311c72 + f3a0e43 commit c3cbe5f
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 13 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

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.3.0] - 2023-11-09

+ Add - `BehaviorTimeSeries` table

## [0.2.3] - 2023-06-20

+ Update - GitHub Actions workflows
Expand Down Expand Up @@ -43,6 +47,7 @@ Observes [Semantic Versioning](https://semver.org/spec/v2.0.0.html) standard and
+ Add - AlignmentEvent design to capture windows relative to an event
+ Add - Black formatting into code base

[0.3.0]: https://github.com/datajoint/element-event/releases/tag/0.3.0
[0.2.3]: https://github.com/datajoint/element-event/releases/tag/0.2.3
[0.2.2]: https://github.com/datajoint/element-event/releases/tag/0.2.2
[0.2.1]: https://github.com/datajoint/element-event/releases/tag/0.2.1
Expand Down
21 changes: 19 additions & 2 deletions element_event/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,14 +146,14 @@ class Event(dj.Imported):
Attributes:
BehaviorRecording (foreign key): Behavior recording primary key.
EventType (foreign key): EventType primary key.
event_start_time (decimal(10, 4)): Time of event onset in seconds, WRT recording start.
event_start_time (decimal): Time of event onset in seconds, WRT recording start.
event_end_time (float): Optional. Seconds WRT recording start.
"""

definition = """
-> BehaviorRecording
-> EventType
event_start_time : decimal(10, 4) # (second) relative to recording start
event_start_time : decimal(10, 6) # (second) relative to recording start
---
event_end_time=null : float # (second) relative to recording start
"""
Expand Down Expand Up @@ -193,3 +193,20 @@ class AlignmentEvent(dj.Manual):
-> EventType.proj(end_event_type='event_type') # event after alignment_event_type
end_time_shift: float # (s) WRT end_event_type
"""


@schema
class BehaviorTimeSeries(dj.Imported):
definition = """
-> BehaviorRecording
timeseries_name : varchar(32) # e.g. joystick, lick_port
---
sample_rate=null : float # (Hz) # sampling rate of the acquired data
behavior_timeseries : longblob # array of device's acquired data
behavior_timestamps=null : longblob # array of timestamps (in second) relative to the start of the BehaviorRecording
timeseries_description='' : varchar(1000) # detailed description about the timeseries
"""

def make(self, key):
"""Populate based on unique entries in BehaviorRecording."""
# Write a make function to automatically ingest your timeseries data.
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.3.0"
20 changes: 10 additions & 10 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,27 @@
pkg_name = "element_event"
here = path.abspath(path.dirname(__file__))

with open(path.join(here, 'README.md'), 'r') as f:
with open(path.join(here, "README.md"), "r") as f:
long_description = f.read()

with open(path.join(here, 'requirements.txt')) as f:
with open(path.join(here, "requirements.txt")) as f:
requirements = f.read().splitlines()

with open(path.join(here, pkg_name, 'version.py')) as f:
with open(path.join(here, pkg_name, "version.py")) as f:
exec(f.read())

setup(
name=pkg_name.replace('_', '-'),
name=pkg_name.replace("_", "-"),
version=__version__,
description="DataJoint Elements for Trialized Experiments",
long_description=long_description,
long_description_content_type='text/markdown',
author='DataJoint',
author_email='[email protected]',
license='MIT',
long_description_content_type="text/markdown",
author="DataJoint",
author_email="[email protected]",
license="MIT",
url=f'https://github.com/datajoint/{pkg_name.replace("_", "-")}',
keywords='neuroscience behavior bpod trials datajoint',
packages=find_packages(exclude=['contrib', 'docs', 'tests*']),
keywords="neuroscience behavior bpod trials datajoint",
packages=find_packages(exclude=["contrib", "docs", "tests*"]),
scripts=[],
install_requires=requirements,
)

0 comments on commit c3cbe5f

Please sign in to comment.