Skip to content
Open
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
8 changes: 5 additions & 3 deletions src/ccbr_tools/paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,14 +121,16 @@ def glob_files(
].

Returns:
set of pathlib.Path: A set of `pathlib.Path` objects representing the matched files.
set of pathlib.Path: A set of `pathlib.Path` objects representing the matched files
sorted by modification time (newest first)
"""
return {
files = [
pathlib.Path(f)
for pattern in patterns
for f in glob.glob(f"{pipeline_outdir}/**/{pattern}", recursive=True)
if pathlib.Path(f).is_file()
}
]
return sorted(files, key=lambda p: p.stat().st_mtime, reverse=True)
Comment on lines +124 to +133
Copy link
Member

@kelly-sovacool kelly-sovacool May 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this will break existing code that uses glob_files and expects it to be a set

grep -r glob_files src

src/ccbr_tools/spooker.py:from .paths import get_tree, load_tree, get_disk_usage, glob_files
src/ccbr_tools/spooker.py:    log_file = glob_files(
src/ccbr_tools/paths.py:def glob_files(
src/ccbr_tools/jobby.py:from .paths import glob_files
src/ccbr_tools/jobby.py:        out_files = glob_files(workdir, patterns=[f"*{job_id}*.out", ".command.out"])
src/ccbr_tools/jobby.py:        err_files = glob_files(workdir, patterns=[f"*{job_id}*.err", ".command.err"])



def create_tar_archive(files, tar_filename):
Expand Down
Loading