Skip to content

Commit

Permalink
code formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
mochic committed Apr 3, 2024
1 parent 71f4f99 commit 46334ec
Show file tree
Hide file tree
Showing 22 changed files with 533 additions and 400 deletions.
1 change: 1 addition & 0 deletions doc_template/source/conf.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Configuration file for the Sphinx documentation builder."""

#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
Expand Down
1 change: 1 addition & 0 deletions examples/bergamo_session.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Example of how to use the bergamo session module"""

from datetime import datetime
from pathlib import Path

Expand Down
1 change: 1 addition & 0 deletions src/aind_metadata_mapper/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
"""Init package"""

__version__ = "0.6.0"
155 changes: 79 additions & 76 deletions src/aind_metadata_mapper/bergamo/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
LaserConfig,
Modality,
Session,
Stream,
StimulusEpoch,
StimulusModality
StimulusModality,
Stream,
)
from aind_data_schema.models.stimulus import (
PhotoStimulation,
Expand Down Expand Up @@ -466,87 +466,90 @@ def _transform(self, extracted_source: RawImageInfo) -> Session:
stimulus_modalities=[
StimulusModality.OPTOGENETICS,
],
stimulus_parameters=[PhotoStimulation(
stimulus_name="PhotoStimulation",
number_groups=(
self.job_settings.num_of_photo_stim_groups
),
groups=[
PhotoStimulationGroup(
group_index=(
self.job_settings.photo_stim_groups[0][
"group_index"
]
),
number_of_neurons=int(
np.array(
stimulus_parameters=[
PhotoStimulation(
stimulus_name="PhotoStimulation",
number_groups=(
self.job_settings.num_of_photo_stim_groups
),
groups=[
PhotoStimulationGroup(
group_index=(
self.job_settings.photo_stim_groups[0][
"group_index"
]
),
number_of_neurons=int(
np.array(
photostim_groups[0]["rois"][1][
"scanfields"
]["slmPattern"]
).shape[0]
),
stimulation_laser_power=int(
photostim_groups[0]["rois"][1][
"scanfields"
]["slmPattern"]
).shape[0]
),
stimulation_laser_power=int(
photostim_groups[0]["rois"][1][
"scanfields"
]["powers"]
),
number_trials=(
self.job_settings.photo_stim_groups[0][
"number_trials"
]
),
number_spirals=int(
photostim_groups[0]["rois"][1][
"scanfields"
]["repetitions"]
),
spiral_duration=photostim_groups[0]["rois"][1][
"scanfields"
]["duration"],
inter_spiral_interval=photostim_groups[0][
"rois"
][2]["scanfields"]["duration"],
),
PhotoStimulationGroup(
group_index=(
self.job_settings.photo_stim_groups[1][
"group_index"
]
),
number_of_neurons=int(
np.array(
]["powers"]
),
number_trials=(
self.job_settings.photo_stim_groups[0][
"number_trials"
]
),
number_spirals=int(
photostim_groups[0]["rois"][1][
"scanfields"
]["slmPattern"]
).shape[0]
),
stimulation_laser_power=int(
photostim_groups[0]["rois"][1][
"scanfields"
]["powers"]
]["repetitions"]
),
spiral_duration=photostim_groups[0][
"rois"
][1]["scanfields"]["duration"],
inter_spiral_interval=photostim_groups[0][
"rois"
][2]["scanfields"]["duration"],
),
number_trials=(
self.job_settings.photo_stim_groups[1][
"number_trials"
]
),
number_spirals=int(
photostim_groups[0]["rois"][1][
"scanfields"
]["repetitions"]
PhotoStimulationGroup(
group_index=(
self.job_settings.photo_stim_groups[1][
"group_index"
]
),
number_of_neurons=int(
np.array(
photostim_groups[0]["rois"][1][
"scanfields"
]["slmPattern"]
).shape[0]
),
stimulation_laser_power=int(
photostim_groups[0]["rois"][1][
"scanfields"
]["powers"]
),
number_trials=(
self.job_settings.photo_stim_groups[1][
"number_trials"
]
),
number_spirals=int(
photostim_groups[0]["rois"][1][
"scanfields"
]["repetitions"]
),
spiral_duration=photostim_groups[0][
"rois"
][1]["scanfields"]["duration"],
inter_spiral_interval=photostim_groups[0][
"rois"
][2]["scanfields"]["duration"],
),
spiral_duration=photostim_groups[0]["rois"][1][
"scanfields"
]["duration"],
inter_spiral_interval=photostim_groups[0][
"rois"
][2]["scanfields"]["duration"],
],
inter_trial_interval=(
self.job_settings.
photo_stim_inter_trial_interval
),
],
inter_trial_interval=(
self.job_settings.photo_stim_inter_trial_interval
),
)],
)
],
stimulus_start_time=(
self.job_settings.stimulus_start_time
),
Expand Down
27 changes: 17 additions & 10 deletions src/aind_metadata_mapper/fib/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,12 @@
FiberConnectionConfig,
LightEmittingDiodeConfig,
Session,
Stream,
StimulusEpoch,
StimulusModality,
Stream,
)
from aind_data_schema.models.modalities import Modality
from aind_data_schema.models.stimulus import (
OptoStimulation,
PulseShape,
)
from aind_data_schema.models.stimulus import OptoStimulation, PulseShape
from pydantic import Field
from pydantic_settings import BaseSettings

Expand Down Expand Up @@ -149,10 +146,18 @@ def _transform(self, extracted_source: ParsedMetadata) -> Session:
opto_stim = OptoStimulation(
stimulus_name=stimulus_name,
pulse_shape=PulseShape.SQUARE,
pulse_frequency=[frequency,],
number_pulse_trains=[trial_num, ],
pulse_width=[pulse_width, ],
pulse_train_duration=[opto_duration, ],
pulse_frequency=[
frequency,
],
number_pulse_trains=[
trial_num,
],
pulse_width=[
pulse_width,
],
pulse_train_duration=[
opto_duration,
],
pulse_train_interval=opto_interval,
baseline_duration=opto_base,
fixed_pulse_train_interval=True, # TODO: Check this is right
Expand All @@ -168,7 +173,9 @@ def _transform(self, extracted_source: ParsedMetadata) -> Session:
stimulus_epochs = StimulusEpoch(
stimulus_name=stimulus_name,
stimulus_modalities=[StimulusModality.OPTOGENETICS],
stimulus_parameters=[opto_stim, ],
stimulus_parameters=[
opto_stim,
],
stimulus_start_time=session_start_time,
stimulus_end_time=end_datetime,
)
Expand Down
1 change: 1 addition & 0 deletions src/aind_metadata_mapper/mesoscope/session.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Mesoscope ETL"""

import argparse
import json
import sys
Expand Down
Loading

0 comments on commit 46334ec

Please sign in to comment.