-
Notifications
You must be signed in to change notification settings - Fork 0
feat: sorting glob_files by date #83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## v0.4 #83 +/- ##
=======================================
Coverage ? 75.18%
=======================================
Files ? 25
Lines ? 1785
Branches ? 0
=======================================
Hits ? 1342
Misses ? 443
Partials ? 0 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@kopardev I changed your pull request to merge into main, which is the dev branch. The |
| 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) |
There was a problem hiding this comment.
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"])
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Code that uses
glob_files()will likely need to change, e.g.pop()is asetmethod thatlistdoes not have. See comment - Please fill out the PR template, including a brief description of why the change is necessary.
Changes
Issues
PR Checklist
(
Strikethroughany points that are not applicable.)CHANGELOG.mdwith a short description of any user-facing changes and reference the PR number. Guidelines: https://keepachangelog.com/en/1.1.0/