Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Dec 17, 2024
1 parent 62d7a40 commit 4202759
Showing 1 changed file with 7 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

import os
from pathlib import Path
from shutil import rmtree

from one.api import ONE

Expand Down Expand Up @@ -49,39 +48,33 @@
data_interfaces = list()

# These interfaces should always be present in source data
data_interfaces.append(IblSortingInterface(session=eid, cache_folder=one_cache_folder_path / "sorting", revision=revision))
data_interfaces.append(
IblSortingInterface(session=eid, cache_folder=one_cache_folder_path / "sorting", revision=revision)
)
data_interfaces.append(BrainwideMapTrialsInterface(one=one, session=eid, revision=revision))
data_interfaces.append(WheelInterface(one=one, session=eid, revision=revision))

# These interfaces may not be present; check if they are before adding to list
pose_estimation_files = one.list_datasets(eid=eid, filename="*.dlc*")
for pose_estimation_file in pose_estimation_files:
camera_name = pose_estimation_file.replace("alf/_ibl_", "").replace(".dlc.pqt", "")
data_interfaces.append(
IblPoseEstimationInterface(one=one, session=eid, camera_name=camera_name, revision=revision)
)
data_interfaces.append(IblPoseEstimationInterface(one=one, session=eid, camera_name=camera_name, revision=revision))

pupil_tracking_files = one.list_datasets(eid=eid, filename="*features*")
for pupil_tracking_file in pupil_tracking_files:
camera_name = pupil_tracking_file.replace("alf/_ibl_", "").replace(".features.pqt", "")
data_interfaces.append(
PupilTrackingInterface(one=one, session=eid, camera_name=camera_name, revision=revision)
)
data_interfaces.append(PupilTrackingInterface(one=one, session=eid, camera_name=camera_name, revision=revision))

roi_motion_energy_files = one.list_datasets(eid=eid, filename="*ROIMotionEnergy.npy*")
for roi_motion_energy_file in roi_motion_energy_files:
camera_name = roi_motion_energy_file.replace("alf/", "").replace(".ROIMotionEnergy.npy", "")
data_interfaces.append(
RoiMotionEnergyInterface(one=one, session=eid, camera_name=camera_name, revision=revision)
)
data_interfaces.append(RoiMotionEnergyInterface(one=one, session=eid, camera_name=camera_name, revision=revision))

if one.list_datasets(eid=eid, collection="alf", filename="licks*"):
data_interfaces.append(LickInterface(one=one, session=eid, revision=revision))

# Run conversion
session_converter = BrainwideMapConverter(
one=one, session=eid, data_interfaces=data_interfaces, verbose=True
)
session_converter = BrainwideMapConverter(one=one, session=eid, data_interfaces=data_interfaces, verbose=True)

metadata = session_converter.get_metadata()
subject_id = metadata["Subject"]["subject_id"]
Expand Down

0 comments on commit 4202759

Please sign in to comment.