mirror of
https://gitlab.crans.org/bde/nk20
synced 2024-11-27 02:43:01 +00:00
[WEI] Fix quotas
Signed-off-by: Yohann D'ANELLO <ynerant@crans.org>
This commit is contained in:
parent
1ef25924a0
commit
9583cec3ff
@ -204,13 +204,21 @@ class WEISurveyAlgorithm2021(WEISurveyAlgorithm):
|
|||||||
# Repartition for non men people first
|
# Repartition for non men people first
|
||||||
self.make_repartition(non_men, quotas, tqdm_obj=tqdm_obj)
|
self.make_repartition(non_men, quotas, tqdm_obj=tqdm_obj)
|
||||||
|
|
||||||
|
quotas = {}
|
||||||
|
for bus in self.get_buses():
|
||||||
|
free_seats = bus.size - WEIMembership.objects.filter(bus=bus, registration__first_year=False).count()
|
||||||
|
free_seats -= sum(1 for s in non_men if s.information.selected_bus_pk == bus.pk)
|
||||||
|
quotas[bus] = free_seats
|
||||||
|
|
||||||
|
print(quotas)
|
||||||
|
|
||||||
if display_tqdm:
|
if display_tqdm:
|
||||||
tqdm_obj.close()
|
tqdm_obj.close()
|
||||||
|
|
||||||
from tqdm import tqdm
|
from tqdm import tqdm
|
||||||
tqdm_obj = tqdm(total=len(men), desc="Hommes")
|
tqdm_obj = tqdm(total=len(men), desc="Hommes")
|
||||||
|
|
||||||
self.make_repartition(men, tqdm_obj=tqdm_obj)
|
self.make_repartition(men, quotas, tqdm_obj=tqdm_obj)
|
||||||
|
|
||||||
if display_tqdm:
|
if display_tqdm:
|
||||||
tqdm_obj.close()
|
tqdm_obj.close()
|
||||||
|
Loading…
Reference in New Issue
Block a user