Skip to content

Commit bcde44f

Browse files
authored
Merge pull request #19 from DigitalHolography/remove_intermediate_output_folders
remove intermediate output folders
2 parents 2a77e2f + ae312a6 commit bcde44f

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ Launch the main application to process files interactively:
7171
7272
### GUI
7373
74-
The GUI handles batch processing for folders, single .h5/.hdf5 files, or .zip archives and lets you run multiple pipelines at once.
74+
The GUI handles batch processing for folders, single .h5/.hdf5 files, or .zip archives and lets you run multiple pipelines at once. Batch outputs are written directly into the chosen output directory (one combined `.h5` per input file).
7575
7676
```sh
7777
# Via the entry point

src/angio_eye.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -477,9 +477,15 @@ def _run_pipelines_on_file(
477477
pipelines: Sequence[PipelineDescriptor],
478478
output_root: Path,
479479
) -> None:
480-
data_dir = output_root / h5_path.stem
481-
data_dir.mkdir(parents=True, exist_ok=True)
482-
combined_h5_out = data_dir / f"{h5_path.stem}_pipelines_result.h5"
480+
# Place combined output directly in the output root (no per-file subfolder).
481+
combined_h5_out = output_root / f"{h5_path.stem}_pipelines_result.h5"
482+
suffix = 1
483+
while combined_h5_out.exists():
484+
combined_h5_out = (
485+
output_root / f"{h5_path.stem}_{suffix}_pipelines_result.h5"
486+
)
487+
suffix += 1
488+
483489
pipeline_results: list[tuple[str, ProcessResult]] = []
484490
with h5py.File(h5_path, "r") as h5file:
485491
for pipeline_desc in pipelines:
@@ -492,9 +498,7 @@ def _run_pipelines_on_file(
492498
)
493499
for _, result in pipeline_results:
494500
result.output_h5_path = str(combined_h5_out)
495-
self._log_batch(
496-
f"[OK] {h5_path.name}: combined results -> {combined_h5_out.name}"
497-
)
501+
self._log_batch(f"[OK] {h5_path.name}: combined results -> {combined_h5_out}")
498502

499503
def _zip_output_dir(self, folder: Path, target_path: Path | None = None) -> Path:
500504
folder = folder.expanduser().resolve()

0 commit comments

Comments
 (0)