| Total Complexity | 5 |
| Total Lines | 34 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | # -*- coding: utf-8 -*- |
||
| 2 | |||
| 3 | """ |
||
| 4 | Solph Facade based on oemof.network.SubNetwork |
||
| 5 | |||
| 6 | SPDX-FileCopyrightText: Uwe Krien <[email protected]> |
||
| 7 | SPDX-FileCopyrightText: Pierre-François Duc |
||
| 8 | |||
| 9 | SPDX-License-Identifier: MIT |
||
| 10 | |||
| 11 | """ |
||
| 12 | |||
| 13 | from oemof.network import SubNetwork |
||
| 14 | |||
| 15 | |||
| 16 | class Facade(SubNetwork): |
||
| 17 | # attributes |
||
| 18 | def __init__(self,*args,**kwargs): |
||
| 19 | self.facade_type = None |
||
| 20 | |||
| 21 | def add_subnode(self,*args): |
||
| 22 | """Add a subnode to the subnetwork""" |
||
| 23 | for sub_component in args: |
||
| 24 | sub_component.label = self._sub_component_labelling(sub_component.label) |
||
| 25 | super(self).add_subnode(sub_component) |
||
| 26 | |||
| 27 | def build_subnetwork(self): |
||
| 28 | """Instanciate and add Node instance to the sub network""" |
||
| 29 | pass |
||
| 30 | |||
| 31 | def _sub_component_labelling(self, sub_component_label): |
||
| 32 | """Method to always keep the Facade instance label in its subcomponents""" |
||
| 33 | return f"{self.label}_{sub_component_label}" |
||
| 34 |