diff --git a/main.py b/main.py index 4a87d34700e80d6280345dea5a2ed8e39205060f..02f50fe26012813e7afb133be7da46f674580b97 100644 --- a/main.py +++ b/main.py @@ -51,7 +51,7 @@ def verifier_apogee_vs_theory(): for index, row in df.iterrows(): group1 = row['COD_EXT_GPE'] group2 = row['COD_EXT_GPE1'] - # Normaliser l'ordre pour garantir la cohérence + # normalisation de l'ordre pour garantir la cohérence group_pair = tuple(sorted((group1, group2))) incompatibility, g1_sillons, g2_sillons = check_incompatibility(group1, group2, sillon_to_groups) @@ -63,14 +63,17 @@ def verifier_apogee_vs_theory(): # fonction qui génére toutes les incomp d'après la théorie de l'association groupes/sillons def incomp_theory_creator(): for sillon, groups in sillon_to_groups.items(): - all_incompatibilities_theory.update(combinations(groups, 2)) + # ajout de toutes les paires du même sillon + for group1, group2 in combinations(groups, 2): + all_incompatibilities_theory.add(tuple(sorted((group1, group2)))) + # ajout des paires entre demi-sillons A et non-A ou B et non-B base_sillon = ''.join(filter(str.isdigit, sillon)) for other_sillon, other_groups in sillon_to_groups.items(): if other_sillon != sillon and ''.join(filter(str.isdigit, other_sillon)) == base_sillon: if not ((sillon.endswith('A') and other_sillon.endswith('B')) or (sillon.endswith('B') and other_sillon.endswith('A'))): for group1 in groups: for group2 in other_groups: - all_incompatibilities_theory.add((group1, group2)) + all_incompatibilities_theory.add(tuple(sorted((group1, group2)))) # fonction qui vérifie si une incomp qui devrait exister en théorie est bien enregistrée dans Apogee. # Si ce n'est pas le cas alors un message d'erreur est affiché.