Skip to content

Commit

Permalink
Corrections OTFA (référence/cible)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucduron committed Jul 13, 2023
1 parent 8fb6eea commit 7f6a130
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 20 deletions.
29 changes: 18 additions & 11 deletions crue10/campagne_otfa.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
from snippets._params import ETATREF_SCENARIO_PAR_AMENAGEMENT


DOSSIER_REF = os.path.join('..', '..', 'Crue10_examples', 'sharepoint_modeles_Conc')
DOSSIER_CIBLE = os.path.join('..', '..', 'Crue10_examples', 'sharepoint_modeles_Conc_g1.3')
DOSSIER_REF = os.path.join('..', '..', 'SHY_C10_Crue10_Cas-tests_gprec', 'Conc')
DOSSIER_CIBLE = os.path.join('..', '..', 'SHY_C10_Crue10_Cas-tests', 'Conc')


class Campagne:
Expand Down Expand Up @@ -94,25 +94,32 @@ def write_otfa(self, folder):
)


# Complet.otfa.xml
otfa = FichierOtfa('Complet', mode='w', files={'otfa': '../../Crue10_examples/Cas-tests/OTFA_C10C10/Complet.otfa.xml'},
# Cas-tests.otfa.xml
otfa = FichierOtfa('Cas-tests', mode='w', files={'otfa': '../../../SHY_C10_Crue10_Cas-tests/OTFA/Cas-tests_avec_gprec.otfa.xml'},
metadata={'Commentaire': "Campagne complète : lancement de toutes les lignes OTFA pour les cas-tests fonctionnels"})
otfa.read_otfa()
otfa.ajouter_cible(os.path.join('..', '..', 'Cas-tests_g1.3'))
otfa.write_otfa('../../Crue10_examples/Cas-tests/OTFA_C10C10_NEW')
for campagne in otfa.campagnes:
campagne.nom_scenario_cible = campagne.nom_scenario_ref
campagne.chemin_etude_cible = campagne.chemin_etude_ref
campagne.chemin_etude_ref = campagne.chemin_etude_cible.replace('..\Cas-tests',
'..\..\SHY_C10_Crue10_Cas-tests_gprec\Cas-tests')
otfa.write_otfa('../../../SHY_C10_Crue10_Cas-tests/OTFA')


# Conc.otfa.xml
otfa = FichierOtfa('Conc', mode='w', files={'otfa': 'Conc.otfa.xml'},
otfa = FichierOtfa('Conc', mode='w', files={'otfa': '../../../SHY_C10_Crue10_Cas-tests/Conc_avec_gprec.otfa.xml'},
metadata={'Commentaire': "OTFA pour les derniers modèles de concession"})
for etude_dossier, nom_scenario in ETATREF_SCENARIO_PAR_AMENAGEMENT.items():
for etu_path in glob(os.path.join(DOSSIER_REF, etude_dossier, '*.etu.xml')): # FIXME: only one etu.xml should be found by folder!
for etu_path in glob(os.path.join('..', DOSSIER_REF, etude_dossier, '*.etu.xml')): # FIXME: only one etu.xml should be found by folder!
etude = Etude(etu_path)
if nom_scenario is None:
nom_scenario = etude.get_scenario_courant().id
campagne = Campagne(os.path.relpath(etu_path, start=os.path.join(DOSSIER_REF, 'OTFA_C10C10')), nom_scenario,
campagne = Campagne(os.path.relpath(os.path.join(DOSSIER_REF, etude_dossier, os.path.basename(etu_path)),
start=os.path.join(DOSSIER_CIBLE, '..', 'OTFA')),
nom_scenario,
os.path.relpath(os.path.join(DOSSIER_CIBLE, etude_dossier, os.path.basename(etu_path)),
start=os.path.join(DOSSIER_REF, 'OTFA_C10C10')), nom_scenario)
start=os.path.join(DOSSIER_CIBLE, '..', 'OTFA')),
nom_scenario)
otfa.ajouter_campagne(campagne)

otfa.write_otfa(os.path.join(DOSSIER_REF, 'OTFA_C10C10'))
otfa.write_otfa('../../../SHY_C10_Crue10_Cas-tests/OTFA')
14 changes: 7 additions & 7 deletions crue10/data/1.2/templates/otfa.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,27 @@
<DateDerniereModif>{{ metadata.DateDerniereModif }}</DateDerniereModif>
<Reference-Options>
<EffacerRunAvant>true</EffacerRunAvant>
<EffacerRunApres>true</EffacerRunApres>
<EffacerRunApres>false</EffacerRunApres>
</Reference-Options>
<Cible-Options>
<EffacerRunAvant>true</EffacerRunAvant>
<EffacerRunApres>true</EffacerRunApres>
<EffacerRunApres>false</EffacerRunApres>
</Cible-Options>
<LignesCampagne>
{%- for campagne in campagnes %}
<LigneCampagne Numero="{{ loop.index0 + 1 }}">
<Commentaire></Commentaire>
<Commentaire>{{ campagne.commentaire }}</Commentaire>
<LancerComparaison>true</LancerComparaison>
<Reference>
<Etude>{{ campagne.chemin_etude }}</Etude>
<Scenario>{{ campagne.nom_scenario }}</Scenario>
<Etude>{{ campagne.chemin_etude_ref }}</Etude>
<Scenario>{{ campagne.nom_scenario_ref }}</Scenario>
<Coeur>old_c10m10</Coeur>
<LancerCalcul>true</LancerCalcul>
<Transitoire>false</Transitoire>
</Reference>
<Cible>
<Etude></Etude>
<Scenario></Scenario>
<Etude>{{ campagne.chemin_etude_cible }}</Etude>
<Scenario>{{ campagne.nom_scenario_cible }}</Scenario>
<Coeur>c10m10</Coeur>
<LancerCalcul>true</LancerCalcul>
<Transitoire>false</Transitoire>
Expand Down
4 changes: 2 additions & 2 deletions crue10/data/1.3/templates/otfa.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
<DateDerniereModif>{{ metadata.DateDerniereModif }}</DateDerniereModif>
<Reference-Options>
<EffacerRunAvant>true</EffacerRunAvant>
<EffacerRunApres>true</EffacerRunApres>
<EffacerRunApres>false</EffacerRunApres>
</Reference-Options>
<Cible-Options>
<EffacerRunAvant>true</EffacerRunAvant>
<EffacerRunApres>true</EffacerRunApres>
<EffacerRunApres>false</EffacerRunApres>
</Cible-Options>
<LignesCampagne>
{%- for campagne in campagnes %}
Expand Down

0 comments on commit 7f6a130

Please sign in to comment.