Skip to content

Commit

Permalink
Merge pull request #289 from JaerongA/datajoint_pipeline
Browse files Browse the repository at this point in the history
Add experiment devices & schema
  • Loading branch information
Thinh Nguyen authored Nov 29, 2023
2 parents a81204b + 58d3fda commit 7f561e3
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
4 changes: 4 additions & 0 deletions aeon/dj_pipeline/acquisition.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,17 @@
"social0-r1": "FrameTop",
"exp0.2-r0": "CameraTop",
"oct1.0-r0": "CameraTop",
"social0.1-a3": "CameraTop",
"social0.1-a4": "CameraTop"
}

_device_schema_mapping = {
"exp0.1-r0": aeon_schema.exp01,
"social0-r1": aeon_schema.exp01,
"exp0.2-r0": aeon_schema.exp02,
"oct1.0-r0": aeon_schema.octagon01,
"social0.1-a3": aeon_schema.social01,
"social0.1-a4": aeon_schema.social01
}


Expand Down
5 changes: 1 addition & 4 deletions aeon/dj_pipeline/utils/load_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -405,8 +405,6 @@ def get_device_mapper(schema: DotMap, metadata_yml_filepath: Path):
device_sn (dict): {"device_name", "serial_number"}
e.g. {'CameraTop': '21053810'}
"""
import os

from aeon.io import api

metadata_yml_filepath = Path(metadata_yml_filepath)
Expand All @@ -420,8 +418,7 @@ def get_device_mapper(schema: DotMap, metadata_yml_filepath: Path):
)

# Store the mapper dictionary here
repository_root = os.popen("git rev-parse --show-toplevel").read().strip() # repo root path
filename = Path(repository_root + "/aeon/dj_pipeline/create_experiments/device_type_mapper.json")
filename = Path(__file__).parent.parent / "create_experiments/device_type_mapper.json"

device_type_mapper = {} # {device_name: device_type}
device_sn = {} # {device_name: device_sn}
Expand Down
15 changes: 15 additions & 0 deletions aeon/schema/dataset.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from dotmap import DotMap

import aeon.schema.core as stream
from aeon.io import reader
from aeon.io.device import Device
from aeon.schema import foraging, octagon

Expand Down Expand Up @@ -57,3 +58,17 @@
Device("Wall8", octagon.Wall),
]
)

social01 = exp02
social01.Patch1.BeamBreak = reader.BitmaskEvent(
pattern="Patch1_32", value=0x22, tag="BeamBroken"
)
social01.Patch2.BeamBreak = reader.BitmaskEvent(
pattern="Patch2_32", value=0x22, tag="BeamBroken"
)
social01.Patch1.DeliverPellet = reader.BitmaskEvent(
pattern="Patch1_35", value=0x1, tag="TriggeredPellet"
)
social01.Patch2.DeliverPellet = reader.BitmaskEvent(
pattern="Patch2_35", value=0x1, tag="TriggeredPellet"
)

0 comments on commit 7f561e3

Please sign in to comment.