Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions align_browser/experiment_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,12 +161,13 @@ def parse_experiments_directory(experiments_root: Path) -> List[ExperimentData]:
"""
Parse the experiments directory structure and return a list of ExperimentData.

Recursively searches through the directory structure to find all directories
First checks if the given path itself is an experiment directory, then
recursively searches through the directory structure to find all directories
that contain the required experiment files (input_output.json, timing.json,
and .hydra/config.yaml). scores.json is optional.

Args:
experiments_root: Path to the root experiments directory
experiments_root: Path to the root experiments directory or a direct experiment directory

Returns:
List of successfully parsed ExperimentData objects
Expand All @@ -177,6 +178,18 @@ def parse_experiments_directory(experiments_root: Path) -> List[ExperimentData]:
directories_with_files = 0
directories_processed = 0

# First check if the root path itself is an experiment directory
if ExperimentData.has_required_files(experiments_root):
directories_found += 1
directories_with_files += 1

try:
directory_experiments = _create_experiments_from_directory(experiments_root)
experiments.extend(directory_experiments)
directories_processed += 1
except Exception as e:
print(f"Error processing {experiments_root}: {e}")

# Recursively find all directories that have required experiment files
for experiment_dir in experiments_root.rglob("*"):
if not experiment_dir.is_dir():
Expand Down
Loading
Loading