-
Notifications
You must be signed in to change notification settings - Fork 4
contributions to objective working and tested #149
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
Conversation
src/gems/model/model.py
Outdated
| objective_operational_contribution: Optional[ExpressionNode] = None | ||
| objective_investment_contribution: Optional[ExpressionNode] = None | ||
| # Objective contribution approach | ||
| objective_contributions: Optional[Dict[str, ExpressionNode]] = None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then you should be able to remove objective_operational_contribution and objective_investment_contribution. Besides objective_contributions should be an objet of type ObjectiveContributions which contains an id and an expression
| _is_objective_contribution_valid( | ||
| self, self.objective_investment_contribution | ||
| ) | ||
| # Validate each contribution if present |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment is useless, code is sufficiently explicit
src/gems/model/parsing.py
Outdated
|
|
||
| # --- new field --- | ||
| objective_contributions: Optional[List[InputObjectiveContribution]] = Field( | ||
| default_factory=lambda: [], alias="objective-contributions" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| default_factory=lambda: [], alias="objective-contributions" | |
| default_factory=list, alias="objective-contributions" |
I think this does the same, but more consistent with previous code
src/gems/model/parsing.py
Outdated
| description: Optional[str] = None | ||
| extra_outputs: Optional[List[InputExtraOutput]] = None | ||
|
|
||
| @model_validator(mode="after") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should explicitly enforce that the models have objective_contributions rather than objective . We do not ant to bother with backward compatibility that will complxify the code (this is not a production code)
…tive-contribution-). All corresponding libs adapted.
| expression: generation >= nb_on * p_min | ||
| - id: Number of units variation | ||
| expression: nb_on = nb_on[t-1] + nb_start - nb_stop | ||
| expression: "nb_on = nb_on[t-1] + nb_start - nb_stop" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you need this ?
| - id: Min down time | ||
| expression: sum(t-d_min_down + 1 .. t, nb_stop) <= nb_units_max[t-d_min_down] - nb_on | ||
| objective: expec(sum(cost * generation)) | ||
| expression: "sum(t-d_min_down + 1 .. t, nb_stop) <= nb_units_max[t-d_min_down] - nb_on" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again why " " ?
No description provided.