Skip to content

Commit

Permalink
fix for download file
Browse files Browse the repository at this point in the history
  • Loading branch information
luiztauffer committed May 6, 2024
1 parent 429fda2 commit eca59f5
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 11 deletions.
33 changes: 24 additions & 9 deletions common/processor_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,17 @@ def run_pipeline(context: PipelineFullContext):
ff = context.input.get_file(download=download)

logger.info('Creating input recording')
recording = NwbRecordingExtractor(
file=ff,
electrical_series_path=context.recording_context.electrical_series_path,
# file_path=context.input.get_url(),
# stream_mode="remfile"
)
if download:
source_file_path = context.input.local_file_name
recording = NwbRecordingExtractor(
file_path=source_file_path,
electrical_series_path=context.recording_context.electrical_series_path,
)
else:
recording = NwbRecordingExtractor(
file=ff,
electrical_series_path=context.recording_context.electrical_series_path,
)

if context.recording_context.stub_test:
logger.info('Running in stub test mode')
Expand Down Expand Up @@ -156,10 +161,20 @@ def run_pipeline(context: PipelineFullContext):

output_fname = 'output/output.nwb'

h5_file = h5py.File(ff, 'r')
with pynwb.NWBHDF5IO(file=h5_file, mode='r', load_namespaces=True) as io:
if download:
nwbhdf5io_kwargs = {
'path': source_file_path,
'mode': 'r',
'load_namespaces': True
}
else:
nwbhdf5io_kwargs = {
'file': h5py.File(ff, 'r'),
'mode': 'r',
'load_namespaces': True
}
with pynwb.NWBHDF5IO(**nwbhdf5io_kwargs) as io:
nwbfile_rec = io.read()

nwbfile_base = create_base_nwb_file(nwbfile_original=nwbfile_rec)

if waveform_extractor is not None:
Expand Down
3 changes: 2 additions & 1 deletion si_mountainsort5/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
results/
scratch/
output/
output/
tmp/
4 changes: 3 additions & 1 deletion si_mountainsort5/test_in_container.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,17 @@ ARGS="test-app-processor --app-dir . --processor spikeinterface_pipeline_mountai

# Run the Docker container, with conveninent volumes
docker run --gpus all \
-v $(pwd)/tmp:/tmp \
-v $(pwd)/results/output:/app/output \
-v $(pwd)/results/results:/app/results \
-v $(pwd)/results/scratch:/app/scratch \
-v $(pwd)/sample_context_1.yaml:/app/sample_context_1.yaml \
-v /mnt/shared_storage/Github/si-dendro-apps/common:/app/common \
-v /mnt/shared_storage/Github/dendro/python:/src/dendro/python \
-v /mnt/shared_storage/Github/spikeinterface_pipelines:/src/spikeinterface_pipelines \
-v /mnt/shared_storage/Github/spikeinterface:/src/spikeinterface \
-w /app \
--entrypoint "$ENTRYPOINT_CMD" \
$IMAGE \
$ARGS

# -v /mnt/shared_storage/Github/spikeinterface:/src/spikeinterface \

0 comments on commit eca59f5

Please sign in to comment.