Passed
Pull Request — dev (#1193)
by Uwe
01:46
created

solph._facades.Facade.define_subnetwork()   A

Complexity

Conditions 1

Size

Total Lines 2
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 2
rs 10
c 0
b 0
f 0
cc 1
nop 1
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