# Copyright (c) 2025, UChicago Argonne, LLC
# BSD OPEN SOURCE LICENSE. Full license can be found in LICENSE
# Copyright (c) 2025, UChicago Argonne, LLC
# BSD OPEN SOURCE LICENSE. Full license can be found in LICENSE
from polaris.runs.run_utils import all_subdirs_of


def list_iterations(proj):
    model_path = proj.polaris_project.model_path
    db_name = proj.polaris_project.run_config.db_name
    return ["root"] + sorted(x.name for x in all_subdirs_of(model_path, db_name))
