Total Complexity | 4 |
Total Lines | 37 |
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, label, facade_type, *args, **kwargs): |
||
19 | super().__init__(label=label) |
||
20 | self.facade_type = facade_type |
||
21 | self.define_subnetwork() |
||
22 | |||
23 | def define_subnetwork(self): |
||
24 | pass |
||
25 | |||
26 | def add_subnetwork(self): |
||
27 | """Instanciate and add Node instance to the sub network""" |
||
28 | pass |
||
29 | |||
30 | def sub_label_error(self, sub_component): |
||
31 | msg = ( |
||
32 | f"Sublabel ERROR in Facade instance:\n{self.label}, " |
||
33 | f"{self.facade_type}, {sub_component}, " |
||
34 | f"{sub_component.custom_properties}" |
||
35 | ) |
||
36 | raise AttributeError(msg) |
||
37 |