refactor: update default parameters and improve CSV download links in gen_proc and leave modules

This commit is contained in:
Ross
2026-07-08 21:34:13 +01:00
parent 09c8124cdd
commit 02598cb665
2 changed files with 79 additions and 56 deletions
+15 -16
View File
@@ -47,9 +47,9 @@ def main(
suspend: bool = False,
solve: bool = True,
time_to_run: int = 60 * 60 * 10,
ratio: float = 0.0001,
start_date: datetime.datetime = "2026-03-02",
weeks: int = 27,
ratio: float = 0.1,
start_date: datetime.datetime = "2026-09-07",
weeks: int = 26,
bom: float = 1,
):
rota_start_date = start_date.date()
@@ -59,18 +59,17 @@ def main(
rota_start_date,
weeks_to_rota=weeks,
balance_offset_modifier=bom,
name="proc_rota3",
name="proc_rota_sep_2026",
)
# Rota = RotaBuilder(start_date, weeks_to_rota=20, balance_offset_modifier=1)
Rota.constraint_options["balance_shifts"] = False
Rota.constraint_options["balance_shifts_quadratic"] = True
Rota.constraint_options["balance_weekends"] = True
Rota.constraint_options["max_night_frequency"] = 4 # 3
#Rota.constraint_options["max_night_frequency"] = 4 # 3
Rota.constraint_options["max_night_frequency_week_exclusions"] = []
Rota.constraint_options["max_weekend_frequency"] = 3
Rota.constraint_options["hard_constrain_pair_separation"] = True
#Rota.constraint_options["max_weekend_frequency"] = 3
Rota.constraint_options["max_days_per_week_block"] = [(8,4)]
#Rota.constraint_options["max_days_per_week_block"] = [(8,4)]
#wr = [
# WorkerRequirement(
@@ -376,9 +375,9 @@ def main(
nwd_end_date = Rota.rota_end_date
if "[" in i:
print("Split nwd", worker_name, i)
#print("Split nwd", worker_name, i)
a, b = i.split("[")[1][:-1].split("-")
print(f"{a=} {b=}")
#print(f"{a=} {b=}")
nwd_start_date = datetime.datetime.strptime(
a, "%d/%m/%Y"
).date()
@@ -432,7 +431,7 @@ def main(
else:
oop = []
print(f"{worker} OOP {oop}")
#print(f"{worker} OOP {oop}")
previous_shifts = {}
# if twi:
@@ -466,10 +465,10 @@ def main(
shift_fte_overrides = {}
if worker_name == "Hadi Mohamed":
shift_fte_overrides = {
"weekend_exeter": 50,
}
#if worker_name == "Hadi Mohamed":
# shift_fte_overrides = {
# "weekend_exeter": 50,
# }
#elif worker_name == "Joel Lim":
# shift_fte_overrides = {
# "plymouth_twilight": 100,
@@ -500,7 +499,7 @@ def main(
shift_fte_overrides=shift_fte_overrides,
)
print(w)
#print(w)
Rota.add_worker(w)
leave.load_academy(Rota)