Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
Incomp Verifierz
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
jbraclet
Incomp Verifierz
Commits
842df2aa
Commit
842df2aa
authored
11 months ago
by
raclet
Browse files
Options
Downloads
Patches
Plain Diff
Ajout du sorted sur les paires de incomp theory
parent
c1db2fdc
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
main.py
+6
-3
6 additions, 3 deletions
main.py
with
6 additions
and
3 deletions
main.py
+
6
−
3
View file @
842df2aa
...
@@ -51,7 +51,7 @@ def verifier_apogee_vs_theory():
...
@@ -51,7 +51,7 @@ def verifier_apogee_vs_theory():
for
index
,
row
in
df
.
iterrows
():
for
index
,
row
in
df
.
iterrows
():
group1
=
row
[
'
COD_EXT_GPE
'
]
group1
=
row
[
'
COD_EXT_GPE
'
]
group2
=
row
[
'
COD_EXT_GPE1
'
]
group2
=
row
[
'
COD_EXT_GPE1
'
]
#
N
ormalise
r
l'ordre pour garantir la cohérence
#
n
ormalis
ation d
e l'ordre pour garantir la cohérence
group_pair
=
tuple
(
sorted
((
group1
,
group2
)))
group_pair
=
tuple
(
sorted
((
group1
,
group2
)))
incompatibility
,
g1_sillons
,
g2_sillons
=
check_incompatibility
(
group1
,
group2
,
sillon_to_groups
)
incompatibility
,
g1_sillons
,
g2_sillons
=
check_incompatibility
(
group1
,
group2
,
sillon_to_groups
)
...
@@ -63,14 +63,17 @@ def verifier_apogee_vs_theory():
...
@@ -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
# fonction qui génére toutes les incomp d'après la théorie de l'association groupes/sillons
def
incomp_theory_creator
():
def
incomp_theory_creator
():
for
sillon
,
groups
in
sillon_to_groups
.
items
():
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
))
base_sillon
=
''
.
join
(
filter
(
str
.
isdigit
,
sillon
))
for
other_sillon
,
other_groups
in
sillon_to_groups
.
items
():
for
other_sillon
,
other_groups
in
sillon_to_groups
.
items
():
if
other_sillon
!=
sillon
and
''
.
join
(
filter
(
str
.
isdigit
,
other_sillon
))
==
base_sillon
:
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
'
))):
if
not
((
sillon
.
endswith
(
'
A
'
)
and
other_sillon
.
endswith
(
'
B
'
))
or
(
sillon
.
endswith
(
'
B
'
)
and
other_sillon
.
endswith
(
'
A
'
))):
for
group1
in
groups
:
for
group1
in
groups
:
for
group2
in
other_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.
# 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é.
# Si ce n'est pas le cas alors un message d'erreur est affiché.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment