1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2025-06-23 02:48:22 +02:00

[WEI] Reset cache after running algorithm

Signed-off-by: Yohann D'ANELLO <ynerant@crans.org>
This commit is contained in:
2021-09-27 13:56:10 +02:00
parent 6b4d18f4b3
commit ac8453b04c
2 changed files with 20 additions and 0 deletions

View File

@ -169,6 +169,11 @@ class WEISurvey2021(WEISurvey):
values.sort(key=lambda item: -item[1])
return values
@classmethod
def clear_cache(cls):
cls.word_mean.cache_clear()
return super().clear_cache()
class WEISurveyAlgorithm2021(WEISurveyAlgorithm):
"""
@ -240,6 +245,9 @@ class WEISurveyAlgorithm2021(WEISurveyAlgorithm):
if display_tqdm:
tqdm_obj.close()
# Clear cache information after running algorithm
WEISurvey2021.clear_cache()
def make_repartition(self, surveys, quotas=None, tqdm_obj=None):
free_surveys = surveys.copy() # Remaining surveys
while free_surveys: # Some students are not affected