Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: DataJoint Contribution Guideline
url: https://datajoint.com/docs/community/contribute/
url: https://docs.datajoint.com/about/contribute/
about: Please make sure to review the DataJoint Contribution Guidelines
10 changes: 10 additions & 0 deletions .github/workflows/devcontainer-build-publish-caller.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: devcontainer_build_publish
on:
workflow_dispatch:

jobs:
call_devcontainer_build_publish:
uses: datajoint/.github/.github/workflows/devcontainer-build-publish.yaml@main
secrets:
DOCKERHUB_USERNAME: ${{secrets.DOCKERHUB_USERNAME}}
DOCKERHUB_TOKEN: ${{secrets.DOCKERHUB_TOKEN_FOR_ELEMENTS}}
9 changes: 9 additions & 0 deletions .github/workflows/mkdocs-release-caller.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: mkdocs-release
on:
workflow_dispatch:

jobs:
mkdocs_release:
uses: datajoint/.github/.github/workflows/mkdocs_release.yaml@main
permissions:
contents: write
10 changes: 10 additions & 0 deletions .github/workflows/semantic-release-caller.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: semantic-release
on:
workflow_dispatch:

jobs:
call_semantic_release:
uses: datajoint/.github/.github/workflows/semantic-release.yaml@main
secrets:
APP_ID: ${{ secrets.ELEMENT_APP_ID }}
GET_TOKEN_KEY: ${{ secrets.ELEMENT_GET_TOKEN_KEY }}
12 changes: 5 additions & 7 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
name: Test
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
jobs:
tests:
runs-on: ubuntu-latest
strategy:
matrix:
py_ver: ["3.9", "3.10"]
mysql_ver: ["8.0", "5.7"]
include:
- py_ver: "3.8"
mysql_ver: "5.7"
- py_ver: "3.7"
mysql_ver: "5.7"
mysql_ver: ["8.0"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{matrix.py_ver}}
Expand All @@ -29,4 +28,3 @@ jobs:
run: |
python_version=${{matrix.py_ver}}
black element_event --check --verbose --target-version py${python_version//.}

11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@

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.5] - 2024-10-25

+ Update - `trial_type` to varchar(24) in `TrialType` table

## [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 Expand Up @@ -43,6 +52,8 @@ 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.2.5]: https://github.com/datajoint/element-event/releases/tag/0.2.5
[0.2.4]: https://github.com/datajoint/element-event/releases/tag/0.2.4
[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
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Contribution Guidelines

This project follows the [DataJoint Contribution Guidelines](https://docs.datajoint.org/python/community/02-Contribute.html). Please reference the link for more full details.
This project follows the [DataJoint Contribution Guidelines](https://docs.datajoint.com/about/contribute/). Please reference the link for more full details.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@

+ `element-event` can be flexibly attached to any DataJoint workflow.

+ See the [Element Event documentation](https://elements.datajoint.org/description/event/) for the background information and development timeline.
+ See the [Element Event documentation](https://docs.datajoint.com/elements/element-event/) for the background information and development timeline.

+ For more information on the DataJoint Elements project, please visit https://elements.datajoint.org. This work is supported by the National Institutes of Health.
+ For more information on the DataJoint Elements project, please visit <https://docs.datajoint.com/elements/>. This work is supported by the National Institutes of Health.

## Element architecture

Expand Down
2 changes: 1 addition & 1 deletion docs/mkdocs.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# ---------------------- PROJECT SPECIFIC ---------------------------

site_name: DataJoint Documentation
site_url: http://localhost/docs/elements/element-event
site_url: https://docs.datajoint.com/elements/element-event/
repo_url: https://github.com/datajoint/element-event
repo_name: datajoint/element-event
nav:
Expand Down
3 changes: 1 addition & 2 deletions docs/src/.overrides/assets/stylesheets/extra.css
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ html a[title="YouTube"].md-social__link svg {
/* --md-footer-fg-color: var(--dj-white); */
}

[data-md-color-scheme="slate"] td,
th {
[data-md-color-scheme="slate"] .jupyter-wrapper .Table Td {
color: var(--dj-black)
}
19 changes: 5 additions & 14 deletions docs/src/.overrides/partials/nav.html
Original file line number Diff line number Diff line change
@@ -1,23 +1,14 @@
{% set class = "md-nav md-nav--primary" %} {% if "navigation.tabs" in features
%} {% set class = class ~ " md-nav--lifted" %} {% endif %} {% if "toc.integrate"
in features %} {% set class = class ~ " md-nav--integrated" %} {% endif %}
<nav
class="{{ class }}"
aria-label="{{ lang.t('nav.title') }}"
data-md-level="0"
>
<nav class="{{ class }}" aria-label="{{ lang.t('nav.title') }}" data-md-level="0">
<label class="md-nav__title" for="__drawer">
<a
href="{{ config.extra.homepage | d(nav.homepage.url, true) | url }}"
title="{{ config.site_name | e }}"
class="md-nav__button md-logo"
aria-label="{{ config.site_name }}"
data-md-component="logo"
>
<a href="{{ config.extra.homepage | d(nav.homepage.url, true) | url }}" title="{{ config.site_name | e }}"
class="md-nav__button md-logo" aria-label="{{ config.site_name }}" data-md-component="logo">
{% include "partials/logo.html" %}
</a>
{#- Add DataJoint home link to navigation header, otherwise unchanged -#}
<a href="https://datajoint.com/docs/elements/" title="DataJoint Elements">
<a href="https://docs.datajoint.com/elements/" title="DataJoint Elements">
⬅ Home
</a>
</label>
Expand All @@ -28,4 +19,4 @@
{% for nav_item in nav %} {% set path = "__nav_" ~ loop.index %} {% set
level = 1 %} {% include "partials/nav-item.html" %} {% endfor %}
</ul>
</nav>
</nav>
4 changes: 2 additions & 2 deletions docs/src/concepts.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,15 @@ Event connects to upstream Element Session.

![element-event diagram](https://raw.githubusercontent.com/datajoint/element-event/main/images/trial_event_diagram.svg)

### `subject` schema ([API docs](https://datajoint.com/docs/elements/element-animal/api/element_animal/subject))
### `subject` schema ([API docs](https://docs.datajoint.com/elements/element-animal/latest/api/element_animal/subject/))

Although not required, most choose to connect the `Session` table to a `Subject` table.

| Table | Description |
| --- | --- |
| Subject | Basic information of the research subject. |

### `session` schema ([API docs](https://datajoint.com/docs/elements/element-session/api/element_session/session_with_datetime))
### `session` schema ([API docs](https://docs.datajoint.com/elements/element-session/latest/api/element_session/session_with_datetime/))

| Table | Description |
| --- | --- |
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
4 changes: 2 additions & 2 deletions element_event/trial.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,12 @@ class TrialType(dj.Lookup):
"""Set of unique trial types present within a recording session

Attributes:
trial_type ( varchar(16) ): Name of trial type
trial_type ( varchar(24) ): Name of trial type
trial_type_description ( varchar(256) ): Optional. Long Description.
"""

definition = """
trial_type : varchar(16)
trial_type : varchar(24)
---
trial_type_description='' : varchar(256)
"""
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.5"