diff --git a/src/Model/HydraulicStructures/Basic/Types.py b/src/Model/HydraulicStructures/Basic/Types.py index 137b272fa1cc8f33b99f1d9fd5dd57a0098f055a..638250557d39bea34cb0b768d90c642002a78adc 100644 --- a/src/Model/HydraulicStructures/Basic/Types.py +++ b/src/Model/HydraulicStructures/Basic/Types.py @@ -51,9 +51,9 @@ class SeuilDeversoir(BasicHS): self._type = "S1" self._data = [ - BHSValue("Cote", float, 1.0), - BHSValue("Largeur", float, 1.0), - BHSValue("Coefficient de debit", float, 0.4), + BHSValue("Cote", float, 1.0, status=status), + BHSValue("Largeur", float, 1.0, status=status), + BHSValue("Coefficient de debit", float, 0.4, status=status), ] @@ -67,11 +67,11 @@ class SeuilTrapezoidal(BasicHS): self._type = "S2" self._data = [ - BHSValue("Cote", float, 1.0), - BHSValue("Largeur", float, 1.0), - BHSValue("Tangeante du demi angle", float, 1.0), - BHSValue("Coefficient de debit", float, 0.4), - BHSValue("Cote de mise en charge", float, 9999.0), + BHSValue("Cote", float, 1.0, status=status), + BHSValue("Largeur", float, 1.0, status=status), + BHSValue("Tangeante du demi angle", float, 1.0, status=status), + BHSValue("Coefficient de debit", float, 0.4, status=status), + BHSValue("Cote de mise en charge", float, 9999.0, status=status), ] @@ -85,10 +85,10 @@ class SeuilTriangulaire(BasicHS): self._type = "S3" self._data = [ - BHSValue("Cote", float, 1.0), - BHSValue("Tangeante du demi angle", float, 1.0), - BHSValue("Coefficient de debit", float, 0.4), - BHSValue("Cote de mise en charge", float, 9999.0), + BHSValue("Cote", float, 1.0, status=status), + BHSValue("Tangeante du demi angle", float, 1.0, status=status), + BHSValue("Coefficient de debit", float, 0.4, status=status), + BHSValue("Cote de mise en charge", float, 9999.0, status=status), ] @@ -102,11 +102,13 @@ class OrificeRectangulaire(BasicHS): self._type = "OR" self._data = [ - BHSValue("Cote", float, 0.0), - BHSValue("Largeur", float, 0.0), - BHSValue("Cote de mise en charge", float, 9999.0), - BHSValue("Cote de mise en charge maximale", float, 9999.0), - BHSValue("Coefficient de debit", float, 0.4), + BHSValue("Cote", float, 0.0, status=status), + BHSValue("Largeur", float, 0.0, status=status), + BHSValue("Cote de mise en charge", float, 9999.0, + status=status), + BHSValue("Cote de mise en charge maximale", float, 9999.0, + status=status), + BHSValue("Coefficient de debit", float, 0.4, status=status), ] @@ -120,10 +122,10 @@ class OrificeCirculaire(BasicHS): self._type = "OC" self._data = [ - BHSValue("Cote", float, 0.0), - BHSValue("Diametre", float, 0.0), - BHSValue("hauteur envasement", float, 9999.0), - BHSValue("Coefficient de debit", float, 0.4), + BHSValue("Cote", float, 0.0, status=status), + BHSValue("Diametre", float, 0.0, status=status), + BHSValue("hauteur envasement", float, 9999.0, status=status), + BHSValue("Coefficient de debit", float, 0.4, status=status), ] @@ -137,11 +139,11 @@ class OrificeVoute(BasicHS): self._type = "OV" self._data = [ - BHSValue("Cote", float, 1.0), - BHSValue("Largeur", float, 1.0), - BHSValue("Haut de la voute", float, 0.0), - BHSValue("Bas de la voute", float, 0.0), - BHSValue("Coefficient de debit", float, 0.4), + BHSValue("Cote", float, 1.0, status=status), + BHSValue("Largeur", float, 1.0, status=status), + BHSValue("Haut de la voute", float, 0.0, status=status), + BHSValue("Bas de la voute", float, 0.0, status=status), + BHSValue("Coefficient de debit", float, 0.4, status=status), ] @@ -155,10 +157,10 @@ class VanneRectangulaire(BasicHS): self._type = "V1" self._data = [ - BHSValue("Cote", float, 1.0), - BHSValue("Ouverture", float, 1.0), - BHSValue("Largeur", float, 1.0), - BHSValue("Coefficient de debit", float, 0.4), + BHSValue("Cote", float, 1.0, status=status), + BHSValue("Ouverture", float, 1.0, status=status), + BHSValue("Largeur", float, 1.0, status=status), + BHSValue("Coefficient de debit", float, 0.4, status=status), ] @@ -172,10 +174,10 @@ class VanneRectangulaireSimplifiee(BasicHS): self._type = "V1" self._data = [ - BHSValue("Cote", float, 1.0), - BHSValue("Ouverture", float, 1.0), - BHSValue("Largeur", float, 1.0), - BHSValue("Coefficient de debit", float, 0.4), + BHSValue("Cote", float, 1.0, status=status), + BHSValue("Ouverture", float, 1.0, status=status), + BHSValue("Largeur", float, 1.0, status=status), + BHSValue("Coefficient de debit", float, 0.4, status=status), ] @@ -190,9 +192,9 @@ class Borda(BasicHS): self._type = "BO" self._data = [ - BHSValue("Pas espace", float, 0.1), - BHSValue("Seuil", float, 0.15), - BHSValue("Coefficient", float, 0.4), + BHSValue("Pas espace", float, 0.1, status=status), + BHSValue("Seuil", float, 0.15, status=status), + BHSValue("Coefficient", float, 0.4, status=status), ] @@ -207,11 +209,11 @@ class UserDefined(BasicHS): self._type = "UD" self._data = [ - BHSValue("Parameter 1", float, 0.0), - BHSValue("Parameter 2", float, 0.0), - BHSValue("Parameter 3", float, 0.0), - BHSValue("Parameter 4", float, 0.0), - BHSValue("Parameter 5", float, 0.0), + BHSValue("Parameter 1", float, 0.0, status=status), + BHSValue("Parameter 2", float, 0.0, status=status), + BHSValue("Parameter 3", float, 0.0, status=status), + BHSValue("Parameter 4", float, 0.0, status=status), + BHSValue("Parameter 5", float, 0.0, status=status), ] diff --git a/src/Model/Network/Graph.py b/src/Model/Network/Graph.py index 7836a89c9e17d3812580d883f4ae6020a9517d6f..c96345b1242d6911ffb2de58b6151e6ccb7bfc09 100644 --- a/src/Model/Network/Graph.py +++ b/src/Model/Network/Graph.py @@ -221,6 +221,7 @@ class Graph(object): def get_edge_id(self, reach): return next( filter( - lambda e: e[1].id == reach.id, enumerate(self.enable_edges) - ) - )[0] + lambda e: e[1].id == reach.id, + enumerate(self.enable_edges()) + ) + )[0]