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
47de9941
Commit
47de9941
authored
1 year ago
by
raclet
Browse files
Options
Downloads
Patches
Plain Diff
Prise en compte d'un fichier groupe/sillon avec nom de l'UE et cellules fusionnées
parent
b0fe1ff6
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
main.py
+45
-13
45 additions, 13 deletions
main.py
with
45 additions
and
13 deletions
main.py
+
45
−
13
View file @
47de9941
import
pandas
as
pd
import
os
import
openpyxl
from
itertools
import
combinations
file_groupes_sillons
=
'
groupes_sillons/VET_
JC_CLEAN
.xlsx
'
file_groupes_sillons
=
'
groupes_sillons/VET_
Info
.xlsx
'
directory_incomp_path
=
'
incomp_apogee
'
files_incomp_apogee
=
[
os
.
path
.
join
(
directory_incomp_path
,
file
)
for
file
in
os
.
listdir
(
directory_incomp_path
)
if
file
.
endswith
(
'
.xlsx
'
)]
df
=
pd
.
read_excel
(
file_groupes_sillons
)
wb
=
openpyxl
.
load_workbook
(
file_groupes_sillons
)
ws
=
wb
.
active
sillon_to_groups
=
{}
groupe_to_sillons
=
{}
groupe_to_ue
=
{}
all_incompatibilities_apogee
=
set
()
all_incompatibilities_theory
=
set
()
# fonction pour charger les correspondances groupes/sillons
def
dic_creator
():
for
index
,
row
in
df
.
iterrows
():
group_name
=
row
[
'
Nom
'
].
strip
().
upper
()
sillons
=
row
[
'
Sillon
'
]
sillons_list
=
str
(
sillons
).
split
(
'
+
'
)
current_sillon
=
None
current_ue
=
None
for
row
in
ws
.
iter_rows
(
min_row
=
2
,
min_col
=
3
,
max_col
=
5
,
values_only
=
True
):
ue
,
group_name
,
sillon
=
row
group_name
=
group_name
.
strip
().
upper
()
# si la cellule sillon est vide (cas fusion), on utilisera la dernière valeur connue
if
sillon
:
current_sillon
=
sillon
# si la cellule ue est vide (cas fusion), on utilisera la dernière valeur connue
if
ue
:
current_ue
=
ue
sillons_list
=
str
(
current_sillon
).
split
(
'
+
'
)
for
sillon
in
sillons_list
:
sillon
=
sillon
.
strip
()
if
sillon
and
any
(
sillon
==
f
"
{
i
}{
letter
}
"
for
i
in
range
(
1
,
9
)
for
letter
in
[
''
,
'
A
'
,
'
B
'
]):
sillon
=
sillon
.
strip
()
.
upper
()
if
sillon
and
any
(
sillon
==
f
"
{
i
}{
letter
}
"
for
i
in
range
(
1
,
9
)
for
letter
in
[
''
,
'
A
'
,
'
B
'
,
'
a
'
,
'
b
'
]):
if
sillon
in
sillon_to_groups
:
sillon_to_groups
[
sillon
].
append
(
group_name
)
else
:
sillon_to_groups
[
sillon
]
=
[
group_name
]
else
:
print
(
f
"
Sillon pas reconnu:
{
row
}
"
)
groupe_to_sillons
[
group_name
]
=
[
s
.
strip
().
upper
()
for
s
in
sillons_list
]
groupe_to_ue
[
group_name
]
=
current_ue
def
afficher_infos
():
print
(
"
Sillons to Groupes:
"
)
for
sillon
,
groupes
in
sillon_to_groups
.
items
():
print
(
f
"
Sillon
{
sillon
}
:
{
groupes
}
"
)
print
(
"
\n
Groupes to Sillons:
"
)
for
groupe
,
sillons
in
groupe_to_sillons
.
items
():
print
(
f
"
Groupe
{
groupe
}
:
{
sillons
}
"
)
print
(
"
\n
Groupes to Cours:
"
)
for
groupe
,
cours
in
groupe_to_ue
.
items
():
print
(
f
"
Groupe
{
groupe
}
:
{
cours
}
"
)
# fonction pour vérifier si deux groupes donnés sont incompatibles (même sillon
# en tenant compte des demi-sillons)
...
...
@@ -87,8 +118,9 @@ def verifier_theory_vs_apogee():
print
(
"
Aucun oubli détecté.
"
)
dic_creator
()
print
(
"
--- Apogee vs. theory ---
"
)
verifier_apogee_vs_theory
()
incomp_theory_creator
()
print
(
"
--- Theory vs. apogee ---
"
)
verifier_theory_vs_apogee
()
afficher_infos
()
# print("--- Apogee vs. theory ---")
# verifier_apogee_vs_theory()
# incomp_theory_creator()
# print("--- Theory vs. apogee ---")
# verifier_theory_vs_apogee()
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