• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

SPF-OST / pytrnsys_gui / 11576810878

29 Oct 2024 03:09PM UTC coverage: 67.508% (-0.08%) from 67.591%
11576810878

push

github

web-flow
Merge pull request #564 from SPF-OST/560-black-change-line-length-to-pep8-standard-of-79-and-check-ci-reaction

changed line length in black to 79

1054 of 1475 new or added lines in 174 files covered. (71.46%)

150 existing lines in 74 files now uncovered.

10399 of 15404 relevant lines covered (67.51%)

0.68 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

82.22
/trnsysGUI/SteamPowerBlock.py
1
# pylint: skip-file
2

3
import typing as _tp
1✔
4

5
import trnsysGUI.blockItemGraphicItemMixins as _gimx
1✔
6
import trnsysGUI.blockItemHasInternalPiping as _bip
1✔
7
import trnsysGUI.createSinglePipePortItem as _cspi
1✔
8
import trnsysGUI.images as _img
1✔
9
import trnsysGUI.internalPiping as _ip
1✔
10
import trnsysGUI.massFlowSolver.networkModel as _mfn
1✔
11

12

13
class SteamPowerBlock(
1✔
14
    _bip.BlockItemHasInternalPiping, _gimx.SvgBlockItemGraphicItemMixin
15
):
16
    def __init__(self, trnsysType: str, editor, displayName: str) -> None:
1✔
17
        super().__init__(trnsysType, editor, displayName)
1✔
18

19
        self.w = 240
1✔
20
        self.h = 160
1✔
21

22
        self.inputs.append(_cspi.createSinglePipePortItem("i", self))
1✔
23
        self.outputs.append(_cspi.createSinglePipePortItem("o", self))
1✔
24

25
        self.changeSize()
1✔
26

27
    def getDisplayName(self) -> str:
1✔
28
        return self.displayName
×
29

30
    def getInternalPiping(self) -> _ip.InternalPiping:
1✔
31
        inputPort = _mfn.PortItem("In", _mfn.PortItemDirection.INPUT)
×
32
        outputPort = _mfn.PortItem("Out", _mfn.PortItemDirection.OUTPUT)
×
33
        pipe = _mfn.Pipe(inputPort, outputPort)
×
34

NEW
35
        return _ip.InternalPiping(
×
36
            [pipe], {inputPort: self.inputs[0], outputPort: self.outputs[0]}
37
        )
38

39
    @classmethod
1✔
40
    @_tp.override
1✔
41
    def _getImageAccessor(
1✔
42
        cls,
43
    ) -> _img.SvgImageAccessor:  # pylint: disable=arguments-differ
UNCOV
44
        return _img.STEAM_POWER_BLOCK_SVG
×
45

46
    def changeSize(self):
1✔
47
        w = self.w
1✔
48
        h = self.h
1✔
49

50
        delta = 20
1✔
51

52
        if h < 120:
1✔
53
            h = 120
×
54
        if w < 120:
1✔
55
            w = 120
×
56

57
        rect = self.label.boundingRect()
1✔
58
        lw, lh = rect.width(), rect.height()
1✔
59
        lx = (w - lw) / 2
1✔
60
        self.label.setPos(lx, h)
1✔
61

62
        self.origInputsPos = [[0, h - 4 * delta]]
1✔
63
        self.origOutputsPos = [[0, h - 2 * delta]]
1✔
64

65
        self.outputs[0].setPos(
1✔
66
            self.origOutputsPos[0][0], self.origOutputsPos[0][1]
67
        )
68
        self.inputs[0].setPos(
1✔
69
            self.origInputsPos[0][0], self.origInputsPos[0][1]
70
        )
71

72
        self.updateFlipStateH(self.flippedH)
1✔
73
        self.updateFlipStateV(self.flippedV)
1✔
74

75
        return w, h
1✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc