feat: implement sub-block handling for shifts and update constraints in RotaBuilder

This commit is contained in:
Ross
2026-07-10 08:08:51 +01:00
parent d1fbbe2dc9
commit 5ff78faa07
3 changed files with 191 additions and 97 deletions
+4 -3
View File
@@ -74,6 +74,7 @@ def main(
Rota.constraint_options["max_weekend_frequency"] = 3
Rota.constraint_options["max_days_per_week_block"] = [(8,3)]
Rota.constraint_options["maximum_allowed_shift_diff"] = 1
# wr = [
# WorkerRequirement(
@@ -174,11 +175,11 @@ def main(
length=12.5,
days=days[4:],
# balance_offset=3,
rota_on_nwds=True,
force_as_block=True,
#rota_on_nwds=True,
#force_as_block=True,
# assign_as_block=True,
constraints=[PreShiftConstraint(days=2), PostShiftConstraint(days=2)],
# force_as_block_unless_nwd=True
force_as_block_unless_nwd=[["Fri"], ["Sat", "Sun"]],
),
SingleShift(
sites=("torbay", "torbay twilights and weekends"),