Skip to content

Commit

Permalink
dev: passes tests
Browse files Browse the repository at this point in the history
  • Loading branch information
micahwoodard committed Dec 20, 2023
1 parent bbdfa1c commit e1c254a
Show file tree
Hide file tree
Showing 7 changed files with 1,179 additions and 13 deletions.
19 changes: 10 additions & 9 deletions src/aind_metadata_mapper/FIB/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,9 @@
import datetime
import json
import re
import sys
from enum import Enum
from pathlib import Path

if sys.version_info < (3, 11):

class StrEnum(str, Enum):
pass

else:
from enum import StrEnum

from aind_data_schema.core.instrument import Instrument
from aind_data_schema.core.session import Session
from aind_data_schema.models.stimulus import (
Expand All @@ -23,11 +14,21 @@ class StrEnum(str, Enum):
StimulusEpoch,
)


class StrEnum(str, Enum):
"""Base class for creating enumerated constants that are
also subclasses of str"""

pass


SRC_DIR = Path(__file__).resolve().parent
PROJECT_DIR = SRC_DIR.parent


class StimulusName(StrEnum):
"""maps stimulus_name based on command"""

o = "OptoStim10Hz"
p = "OptoStim20Hz"
q = "OptoStim5Hz"
Expand Down
49 changes: 49 additions & 0 deletions tests/resources/FIB/000000_2023-12-20_08-34-44_ophys_session.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"describedBy": "https://raw.githubusercontent.com/AllenNeuralDynamics/aind-data-schema/main/src/aind_data_schema/core/session.py",
"schema_version": "0.1.0",
"experimenter_full_name": [
"Lucas Kinsey",
"Kenta Hagihara"
],
"session_start_time": "2023-12-20T08:34:44.011690",
"session_end_time": "2023-12-20T08:35:32.011690",
"session_type": "Foraging_Photometry",
"iacuc_protocol": "2115",
"rig_id": "ophys_rig",
"calibrations": [],
"maintenance": [],
"subject_id": "000000",
"animal_weight_prior": null,
"animal_weight_post": null,
"weight_unit": "gram",
"data_streams": [],
"stimulus_epochs": [
{
"stimulus": {
"stimulus_type": "OptoStimulation",
"stimulus_name": "",
"pulse_shape": "Square",
"pulse_frequency": 10,
"pulse_frequency_unit": "hertz",
"number_pulse_trains": 2,
"pulse_width": 5000,
"pulse_width_unit": "millisecond",
"pulse_train_duration": "2.0",
"pulse_train_duration_unit": "second",
"fixed_pulse_train_interval": true,
"pulse_train_interval": "18.0",
"pulse_train_interval_unit": "second",
"baseline_duration": "10.0",
"baseline_duration_unit": "second",
"other_parameters": {},
"notes": null
},
"stimulus_start_time": "2023-12-20T08:34:44.011690",
"stimulus_end_time": "2023-12-20T08:35:32.011690"
}
],
"reward_delivery": null,
"reward_consumed_total": null,
"reward_consumed_unit": "microliter",
"notes": "brabrabrabra...."
}
Loading

0 comments on commit e1c254a

Please sign in to comment.