Skip to content

Conversation

isofinly
Copy link

@isofinly isofinly commented Oct 5, 2025

This PR closes #134 and #64

Features:

  1. Maximum Window Time (--window): Allows users to limit the forecast horizon from the default 48 hours to a specified duration T. Window size out of range (1-2880 minutes)
  2. Time Window Constraints (--start-window, --end-window): Enables constraining the suggested start time to specific time windows

Supports different time zones, formats. Enforces start before end.

Examples:

Basic Window Limitation

# Search only next 12 hours instead of 48
cats -d 60 --loc OX1 --window 720

Business Hours Constraint

# Job must start between 9 AM and 5 PM
cats -d 180 --loc SW7 --start-window "09:00" --end-window "17:00"

Maintenance Window

# Job must start during 2-6 AM maintenance window
cats -d 240 --loc M1 --start-window "2024-01-15T02:00" --end-window "2024-01-15T06:00"

Combined Constraints

# 12-hour search window + business hours constraint
cats -d 120 --loc OX1 --window 720 --start-window "09:00" --end-window "17:00"

With Schedulers

# Integration with AT scheduler
cats -d 90 --loc OX1 --start-window "09:00" --end-window "17:00" -s at -c "job.sh"

# Integration with SLURM
cats -d 240 --loc SW7 --window 720 -s sbatch -c "slurm-job.sh"

Copy link

codecov bot commented Oct 9, 2025

Codecov Report

❌ Patch coverage is 99.08537% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.60%. Comparing base (61eee71) to head (6e91dbb).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
cats/__init__.py 96.15% 2 Missing ⚠️
cats/forecast.py 98.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #166      +/-   ##
==========================================
+ Coverage   83.31%   89.60%   +6.29%     
==========================================
  Files          15       16       +1     
  Lines         737     1058     +321     
==========================================
+ Hits          614      948     +334     
+ Misses        123      110      -13     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@andreww andreww self-assigned this Oct 9, 2025
@andreww andreww added the enhancement New feature or request label Oct 9, 2025
@andreww
Copy link
Collaborator

andreww commented Oct 9, 2025

Thanks for this - I'll take some time to give it a proper review but it looks good from a quick first pass. It's good to see tests. I do wonder if we need to keep two sets of forcasts (one with the constraint and one without) and if we can get away with using the constrained forcast with the window going from now to now+48hrs for the unconstraind forcast?

@abhidg
Copy link
Contributor

abhidg commented Oct 9, 2025

Thanks @isonfly! Just a note that the maximum duration should be 47h, see db2d346 and #119 for a discussion of the maximum duration

@isofinly
Copy link
Author

isofinly commented Oct 9, 2025

I've limited max duration to 47h.

Ping me whenever you decide about constrained+unconstrained forecasts. I do not think that it is up to me to decide/suggest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support calculation over specified time < 48 hours by cutoff

3 participants