-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding terms in binding constraints doesn't work #1884
Comments
AnalyseLors de la création du terme de la contrainte couplante, le front-end utilise le endpoint POST {"data":{"area":"area2","cluster":"Base"},"weight":7} Dans la configuration de l'étude, au niveau du fichier [Base]
group = Nuclear
name = Base
co2 = 0.0 ➡ L’ identifiant du cluster correspond bien au nom de la section, c'est-à-dire "Base", avec une majuscule. Le fonction qui implémente ce endpoint est la fonction Cette fonction utilise la méthode SolutionLa solution consiste à corriger la fonction D'autre part, la fonction de lecture des contraintes couplantes Guide de développementLe calcul des IDs de contrainte couplantes peut être implémenté comme suit, ce qui est beaucoup plus simple que l'actuel fonction statique class LinkInfoDTO(BaseModel):
area1: str
area2: str
@property
def constraint_id(self) -> str:
area1 = min(self.area1, self.area2)
area2 = max(self.area1, self.area2)
return f"{area1}%{area2}"
class ClusterInfoDTO(BaseModel):
area: str
cluster: str
@property
def constraint_id(self) -> str:
return f"{self.area}%{self.cluster.lower()}" La fonction # Create an index of thermal clusters for each area.
# This index is used to find the real cluster ID base on its ID in lower case.
thermals_index = {
area_id: {cl.id.lower(): cl.id for cl in area_obj.thermals}
for area_id, area_obj in file_study.config.areas.items()
} Une méthode de classe dans le classe ➡ Un refactoring est nécessaire pour avoir un code plus simple et plus "pyrthonnique". |
Contournement possible : nommer les zones de sorte que |
Description
Provide a clear and concise description of the issue.
Steps to Reproduce
Actual Behavior
Describe what actually happened.
Expected Behavior
The user should ba able to add terms to a binding constraint
Describe what you expected to happen.
Screenshots
Possible Solution
Fix bug ?
If you have a solution in mind, describe it here.
Environment
Additional Information
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: