Add exclude_dates option to PreShiftConstraint and PostShiftConstraint

This commit is contained in:
Ross
2025-12-17 09:19:45 +00:00
parent 108bb572a7
commit 81b2c85d61
2 changed files with 28 additions and 6 deletions
+2 -2
View File
@@ -341,7 +341,7 @@ def main(
constraint_options=RotaConstraintOptions(
balance_weekends=True,
max_shifts_per_week=6,
max_days_per_week_block=[(4, 2), (6, 3)],
max_days_per_week_block=[(4, 2), (4, 3)],
),
)
@@ -356,7 +356,7 @@ def main(
balance_offset=2,
assign_as_block=False,
constraints=[
PreShiftConstraint(days=2, start_date="2025-11-17", exclude_days=("Fri", "Sat", "Sun")),
PreShiftConstraint(days=2, start_date="2025-11-17", exclude_days=("Fri", "Sat", "Sun"), exclude_dates=["2026-04-06", "2026-05-04", "2026-05-25"]),
PostShiftConstraint(days=1, start_date="2025-11-17", exclude_days=("Fri", "Sat", "Sun"), allow_self=True),
],
),