Passed
Pull Request — dev (#821)
by Uwe
02:17
created

ElectricalBus.__init__()   A

Complexity

Conditions 1

Size

Total Lines 5
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 5
rs 10
c 0
b 0
f 0
cc 1
nop 3
1
# -*- coding: utf-8 -*-
2
3
"""
4
In-development electrical bus component.
5
6
SPDX-FileCopyrightText: Uwe Krien <[email protected]>
7
SPDX-FileCopyrightText: Simon Hilpert
8
SPDX-FileCopyrightText: Cord Kaldemeyer
9
SPDX-FileCopyrightText: Patrik Schönfeldt
10
SPDX-FileCopyrightText: Johannes Röder
11
SPDX-FileCopyrightText: jakob-wo
12
SPDX-FileCopyrightText: gplssm
13
SPDX-FileCopyrightText: jnnr
14
15
SPDX-License-Identifier: MIT
16
17
"""
18
19
from oemof.solph.buses._bus import Bus
20
21
22
class ElectricalBus(Bus):
23
    r"""A electrical bus object. Every node has to be connected to BusBlock.
24
    This BusBlock is used in combination with ElectricalLine objects
25
    for linear optimal power flow (lopf) calculations.
26
27
    Parameters
28
    ----------
29
    slack: boolean
30
        If True BusBlock is slack bus for network
31
    v_max: numeric
32
        Maximum value of voltage angle at electrical bus
33
    v_min: numeric
34
        Mininum value of voltag angle at electrical bus
35
36
    Note: This component is experimental. Use it with care.
37
38
    Notes
39
    -----
40
    The following sets, variables, constraints and objective parts are created
41
     * :py:class:`~oemof.solph.blocks.bus.BusBlock`
42
    The objects are also used inside:
43
     * :py:class:`~oemof.solph.experimental._electrical_line.ElectricalLine`
44
45
    """
46
47
    def __init__(self, *args, **kwargs):
48
        super().__init__(*args, **kwargs)
49
        self.slack = kwargs.get("slack", False)
50
        self.v_max = kwargs.get("v_max", 1000)
51
        self.v_min = kwargs.get("v_min", -1000)
52