Asset sizing mixin generalization#469
Conversation
| _make_max_size_var(name=asset_name, lb=lb, ub=ub, nominal=ub / 2.0) | ||
|
|
||
|
|
||
| map_variables_asset = { |
There was a problem hiding this comment.
Still think about a better name for this map
There was a problem hiding this comment.
map_asset_type_to_bound_vars ?
There was a problem hiding this comment.
I like it, updated:)
| "electricity_storage": {"upper_bound_suffix": "Stored_electricity"}, | ||
| } | ||
|
|
||
| # Making the __aggregation_count variable for each asset |
There was a problem hiding this comment.
Update or delete this outdated code comment:
"# Making the __aggregation_count variable for each asset"
| if asset_type in map_variables_asset: | ||
| _make_asset_max_size_vars(asset_type, **map_variables_asset[asset_type]) | ||
| elif asset_type not in ["heat_pipe", "gas_pipe", "cable"]: | ||
| logger.warning(f"Assets of type {asset_type} is not supported for sizing, ") |
There was a problem hiding this comment.
Remove the ", space" at the end of the warning message. Else it seems that a part of the info is missing or not printed after the ",". See below an example:
"
No fixed OPEX cost information specified for asset HeatingDemand_d121
Assets of type node is not supported for sizing,
2026-05-20 13:39:46,374 INFO Starting goal programming
...
"
| ub = _scalar_upper_bound(ub_raw) | ||
| if profile_constraint: | ||
| ub = _get_ub_profile_constraint(asset_name, profile_constraint, ub) | ||
| lb = 0.0 if parameters[f"{asset_name}.state"] == AssetStateEnum.OPTIONAL else ub |
There was a problem hiding this comment.
Previously the lb for a heat_demand the "np.isinf(bounds[f"{asset_name}.Heat_demand"][1])" check was used instead of state. Will this not have an impact now? Same holds for some of the other asset types
There was a problem hiding this comment.
I believe it should work right now. Only in case that that an infinity for the upperbound occurs it might be an issue, but that cannot occur.
| _make_max_size_var(name=asset_name, lb=lb, ub=ub, nominal=ub / 2.0) | ||
|
|
||
|
|
||
| map_variables_asset = { |
There was a problem hiding this comment.
map_asset_type_to_bound_vars ?
| for asset_name in self.energy_system_components.get("heat_source", []): | ||
| ub = bounds[f"{asset_name}.Heat_source"][1] | ||
|
|
||
| def _get_ub_profile_constraint(asset_name, profile_name, ub): |
There was a problem hiding this comment.
why the word "get" in the name if it is doing something similar to the function "_demand_ub(..)" which does not have the word "get" in it? Should the other new function not also get the word "get"?
There was a problem hiding this comment.
I used "get" because we are extracting it from ESDL constraints. whiles "_demand_ub" is just picking the upperbound from the bounds.
| nominal=self.variable_nominal(f"{asset_name}.Secondary_heat"), | ||
| return ub | ||
|
|
||
| def _scalar_upper_bound(bound_ub): |
There was a problem hiding this comment.
Suggested name instead, then it is clear that an action is performed (if applicable of course): _scalarise_upper_bound
There was a problem hiding this comment.
Good one, updated.
|
@FJanssen-TNO review completed |
|
@KobusVanRooyen ready for review again. |
ToDo: