.
This commit is contained in:
+1
-1
@@ -14,4 +14,4 @@ logs/
|
||||
*.db
|
||||
web/rota
|
||||
|
||||
cons/
|
||||
cons/
|
||||
|
||||
@@ -1 +1 @@
|
||||
/home/ross/proc_rota/output/timetable.css
|
||||
/home/ross/proc-rota/output/timetable.css
|
||||
@@ -1 +1 @@
|
||||
/home/ross/proc_rota/output/timetable.js
|
||||
/home/ross/proc-rota/output/timetable.js
|
||||
+4
-3
@@ -92,13 +92,13 @@ class NightConstraint(BaseShiftConstraint):
|
||||
class PreShiftConstraint(BaseShiftConstraint):
|
||||
days: Any = None
|
||||
ignore_shifts: List[str] = []
|
||||
exclude_days: List[str] = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"]
|
||||
exclude_days: List[str] = []
|
||||
allow_self: bool = True
|
||||
|
||||
class PostShiftConstraint(BaseShiftConstraint):
|
||||
days: Any = None
|
||||
ignore_shifts: List[str] = []
|
||||
exclude_days: List[str] = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"]
|
||||
exclude_days: List[str] = []
|
||||
allow_self: bool = True
|
||||
|
||||
class BalanceAcrossGroupsConstraint(BaseShiftConstraint):
|
||||
@@ -389,7 +389,8 @@ class RotaBuilder(object):
|
||||
"max_night_frequency_week_exclusions": [],
|
||||
"max_shifts_per_week": 7,
|
||||
"max_shifts_per_month": 40,
|
||||
"max_days_per_week_block": [(3, 2)], # (max_days, week_block)
|
||||
"max_days_per_week_block": [],
|
||||
#"max_days_per_week_block": [(3, 2)], # (max_days, week_block)
|
||||
# The following will cause an unsolvable problem if a shift
|
||||
# is forced as a block and spans the time peroid
|
||||
"prevent_monday_after_full_weekends": [],
|
||||
|
||||
@@ -108,7 +108,7 @@ def test_nights_fail():
|
||||
length=12.5,
|
||||
days=days[5:],
|
||||
force_as_block=True,
|
||||
constraints=[NightConstraint(), PreShiftConstraint(days=3)],
|
||||
constraints=[NightConstraint(), PreShiftConstraint(days=8), PostShiftConstraint(days=2)],
|
||||
workers_required=2,
|
||||
),
|
||||
SingleShift(
|
||||
@@ -120,6 +120,7 @@ def test_nights_fail():
|
||||
),
|
||||
)
|
||||
Rota.build_and_solve(options={"ratio": 0.000})
|
||||
Rota.export_rota_to_html("night fail", folder="tests")
|
||||
assert Rota.results.solver.status in ("warning", "error")
|
||||
|
||||
def test_nights2():
|
||||
|
||||
Reference in New Issue
Block a user