rename home to remote

This commit is contained in:
Ross
2022-02-24 21:50:37 +00:00
parent 7807e3b1e8
commit 9e873ac5f7
11 changed files with 806 additions and 145 deletions
+13 -13
View File
@@ -49,7 +49,7 @@ class TestDemoRota:
"weekday",
12.5,
days[:5],
balance_offset=10,
balance_offset=1,
workers_required=1,
# We use a different balance weighting for each shift as otherwise
# the shifts can be treated equally (and no target diff)
@@ -60,7 +60,7 @@ class TestDemoRota:
"weekend",
12.5,
days[5:],
balance_offset=40,
balance_offset=4,
# balance_weighting=0.5
),
)
@@ -595,12 +595,12 @@ class TestLimitConstraints:
)
# Rota.constraint_options["max_shifts_per_week"] = 5
# Rota.constraint_options["max_shifts_per_month"] = 20
worker1 = Worker(Rota, "worker1", "group1", 2, home_site="group1")
worker2 = Worker(Rota, "worker2", "group1", 2, home_site="group1")
worker3 = Worker(Rota, "worker3", "group1", 2, home_site="group1")
worker4 = Worker(Rota, "worker4", "group3", 3, home_site="group2")
worker5 = Worker(Rota, "worker5", "group3", 3, home_site="group2")
worker6 = Worker(Rota, "worker6", "group3", 3, home_site="group2")
worker1 = Worker(Rota, "worker1", "group1", 2, remote_site="group1")
worker2 = Worker(Rota, "worker2", "group1", 2, remote_site="group1")
worker3 = Worker(Rota, "worker3", "group1", 2, remote_site="group1")
worker4 = Worker(Rota, "worker4", "group3", 3, remote_site="group2")
worker5 = Worker(Rota, "worker5", "group3", 3, remote_site="group2")
worker6 = Worker(Rota, "worker6", "group3", 3, remote_site="group2")
Rota.add_workers((worker1, worker2, worker3, worker4))
Rota.add_workers((worker5, worker6))
@@ -853,7 +853,7 @@ class TestLimitConstraints:
with pytest.raises(ValueError):
self.Rota.build_and_solve(options={"ratio": 0.1})
def test_constraint_require_home_site_presence(self):
def test_constraint_require_remote_site_presence(self):
self.Rota.shifts = []
self.Rota.add_shifts(
SingleShift(
@@ -864,7 +864,7 @@ class TestLimitConstraints:
balance_offset=40,
workers_required=2,
force_as_block=True,
constraints=[("require_home_site_presence", ("group1", 2))],
constraints=[("require_remote_site_presence", ("group1", 2))],
),
)
self.Rota.build_and_solve(options={"ratio": 0.00})
@@ -887,7 +887,7 @@ class TestLimitConstraints:
assert self.Rota.results.solver.status == "ok"
assert self.Rota.results.solver.termination_condition == "optimal"
def test_constraint_require_home_site_presence2(self):
def test_constraint_require_remote_site_presence2(self):
self.Rota.shifts = []
self.Rota.add_shifts(
SingleShift(
@@ -898,7 +898,7 @@ class TestLimitConstraints:
balance_offset=40,
workers_required=3,
force_as_block=True,
constraints=[("require_home_site_presence", ("group2", 2))],
constraints=[("require_remote_site_presence", ("group2", 2))],
),
)
self.Rota.build_and_solve(options={"ratio": 0.00})
@@ -1058,4 +1058,4 @@ class TestNightUnavailable:
if __name__ == "__main__":
t = TestLimitConstraints()
t.test_constraint_require_home_site_presence()
t.test_constraint_require_remote_site_presence()