13
13
from dandi .organize import organize as dandi_organize
14
14
from dandi .upload import upload as dandi_upload
15
15
from neuroconv .tools .data_transfers import automatic_dandi_upload
16
+ from nwbinspector .tools import get_s3_urls_and_dandi_paths
16
17
from one .api import ONE
17
18
from pynwb import NWBHDF5IO
18
19
from pynwb .image import ImageSeries
19
20
from tqdm import tqdm
20
- from nwbinspector .tools import get_s3_urls_and_dandi_paths
21
21
22
22
from ibl_to_nwb .updated_conversion .brainwide_map import BrainwideMapConverter
23
23
from ibl_to_nwb .updated_conversion .brainwide_map .datainterfaces import (
@@ -48,7 +48,7 @@ def convert_and_upload_parallel_processed_only(
48
48
assert len (os .environ .get ("DANDI_API_KEY" , "" )) > 0 , "Run `export DANDI_API_KEY=...`!"
49
49
50
50
nwbfile_path .parent .mkdir (exist_ok = True )
51
-
51
+
52
52
# Download behavior and spike sorted data for this session
53
53
session_path = base_path / "ibl_conversion" / session
54
54
cache_folder = base_path / "ibl_conversion" / session / "cache"
@@ -72,7 +72,9 @@ def convert_and_upload_parallel_processed_only(
72
72
for pose_estimation_file in pose_estimation_files :
73
73
camera_name = pose_estimation_file .replace ("alf/_ibl_" , "" ).replace (".dlc.pqt" , "" )
74
74
data_interfaces .append (
75
- IblPoseEstimationInterface (one = session_one , session = session , camera_name = camera_name , include_video = False )
75
+ IblPoseEstimationInterface (
76
+ one = session_one , session = session , camera_name = camera_name , include_video = False
77
+ )
76
78
)
77
79
78
80
pupil_tracking_files = session_one .list_datasets (eid = session , filename = "*features*" )
@@ -95,14 +97,16 @@ def convert_and_upload_parallel_processed_only(
95
97
96
98
metadata = session_converter .get_metadata ()
97
99
metadata ["NWBFile" ]["session_id" ] = metadata ["NWBFile" ]["session_id" ] + "-processed-only"
98
-
100
+
99
101
session_converter .run_conversion (
100
102
nwbfile_path = nwbfile_path ,
101
103
metadata = metadata ,
102
104
overwrite = True ,
103
105
)
104
106
automatic_dandi_upload (
105
- dandiset_id = "000409" , nwb_folder_path = nwbfile_path .parent , cleanup = cleanup , #files_mode=files_mode
107
+ dandiset_id = "000409" ,
108
+ nwb_folder_path = nwbfile_path .parent ,
109
+ cleanup = cleanup , # files_mode=files_mode
106
110
)
107
111
if cleanup :
108
112
rmtree (cache_folder )
@@ -152,7 +156,7 @@ def convert_and_upload_parallel_processed_only(
152
156
progress_position = 1 + progress_position ,
153
157
# stub_test=True,
154
158
# files_mode="copy", # useful when debugging
155
- #cleanup=True, # causing shutil error ATM
159
+ # cleanup=True, # causing shutil error ATM
156
160
)
157
161
)
158
162
for future in as_completed (futures ):
0 commit comments