Skip to content

Commit c3cbe5f

Browse files
author
Thinh Nguyen
authored
Merge pull request #36 from kushalbakshi/main
Add `BehaviorTimeSeries` manual table
2 parents 2311c72 + f3a0e43 commit c3cbe5f

File tree

4 files changed

+35
-13
lines changed

4 files changed

+35
-13
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
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.3.0] - 2023-11-09
6+
7+
+ Add - `BehaviorTimeSeries` table
8+
59
## [0.2.3] - 2023-06-20
610

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

50+
[0.3.0]: https://github.com/datajoint/element-event/releases/tag/0.3.0
4651
[0.2.3]: https://github.com/datajoint/element-event/releases/tag/0.2.3
4752
[0.2.2]: https://github.com/datajoint/element-event/releases/tag/0.2.2
4853
[0.2.1]: https://github.com/datajoint/element-event/releases/tag/0.2.1

element_event/event.py

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,14 +146,14 @@ class Event(dj.Imported):
146146
Attributes:
147147
BehaviorRecording (foreign key): Behavior recording primary key.
148148
EventType (foreign key): EventType primary key.
149-
event_start_time (decimal(10, 4)): Time of event onset in seconds, WRT recording start.
149+
event_start_time (decimal): Time of event onset in seconds, WRT recording start.
150150
event_end_time (float): Optional. Seconds WRT recording start.
151151
"""
152152

153153
definition = """
154154
-> BehaviorRecording
155155
-> EventType
156-
event_start_time : decimal(10, 4) # (second) relative to recording start
156+
event_start_time : decimal(10, 6) # (second) relative to recording start
157157
---
158158
event_end_time=null : float # (second) relative to recording start
159159
"""
@@ -193,3 +193,20 @@ class AlignmentEvent(dj.Manual):
193193
-> EventType.proj(end_event_type='event_type') # event after alignment_event_type
194194
end_time_shift: float # (s) WRT end_event_type
195195
"""
196+
197+
198+
@schema
199+
class BehaviorTimeSeries(dj.Imported):
200+
definition = """
201+
-> BehaviorRecording
202+
timeseries_name : varchar(32) # e.g. joystick, lick_port
203+
---
204+
sample_rate=null : float # (Hz) # sampling rate of the acquired data
205+
behavior_timeseries : longblob # array of device's acquired data
206+
behavior_timestamps=null : longblob # array of timestamps (in second) relative to the start of the BehaviorRecording
207+
timeseries_description='' : varchar(1000) # detailed description about the timeseries
208+
"""
209+
210+
def make(self, key):
211+
"""Populate based on unique entries in BehaviorRecording."""
212+
# Write a make function to automatically ingest your timeseries data.

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.3.0"

setup.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,27 @@
44
pkg_name = "element_event"
55
here = path.abspath(path.dirname(__file__))
66

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

10-
with open(path.join(here, 'requirements.txt')) as f:
10+
with open(path.join(here, "requirements.txt")) as f:
1111
requirements = f.read().splitlines()
1212

13-
with open(path.join(here, pkg_name, 'version.py')) as f:
13+
with open(path.join(here, pkg_name, "version.py")) as f:
1414
exec(f.read())
1515

1616
setup(
17-
name=pkg_name.replace('_', '-'),
17+
name=pkg_name.replace("_", "-"),
1818
version=__version__,
1919
description="DataJoint Elements for Trialized Experiments",
2020
long_description=long_description,
21-
long_description_content_type='text/markdown',
22-
author='DataJoint',
23-
author_email='[email protected]',
24-
license='MIT',
21+
long_description_content_type="text/markdown",
22+
author="DataJoint",
23+
author_email="[email protected]",
24+
license="MIT",
2525
url=f'https://github.com/datajoint/{pkg_name.replace("_", "-")}',
26-
keywords='neuroscience behavior bpod trials datajoint',
27-
packages=find_packages(exclude=['contrib', 'docs', 'tests*']),
26+
keywords="neuroscience behavior bpod trials datajoint",
27+
packages=find_packages(exclude=["contrib", "docs", "tests*"]),
2828
scripts=[],
2929
install_requires=requirements,
3030
)

0 commit comments

Comments
 (0)