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

SPF-OST / pytrnsys_gui / 11662562960

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

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/SaltTankBase.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 SaltTankBase(
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 = 120
1✔
20
        self.h = 120
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
    @classmethod
1✔
31
    @_tp.override
1✔
32
    def _getImageAccessor(
1✔
33
        cls,
34
    ) -> _img.SvgImageAccessor:  # pylint: disable=arguments-differ
35
        raise NotImplementedError()
36

37
    def getInternalPiping(self) -> _ip.InternalPiping:
1✔
38
        inputPort = _mfn.PortItem("In", _mfn.PortItemDirection.INPUT)
×
39
        outputPort = _mfn.PortItem("Out", _mfn.PortItemDirection.OUTPUT)
×
40

41
        inputSink = _mfn.TerminalWithFreeFlow(inputPort, "In")
×
42
        outputSink = _mfn.TerminalWithFreeFlow(outputPort, "Out")
×
43

NEW
44
        return _ip.InternalPiping(
×
45
            [inputSink, outputSink],
46
            {inputPort: self.inputs[0], outputPort: self.outputs[0]},
47
        )
48

49
    def changeSize(self):
1✔
50
        w = self.w
1✔
51
        h = self.h
1✔
52

53
        delta = 20
1✔
54

55
        if h < 120:
1✔
56
            h = 120
×
57
        if w < 120:
1✔
58
            w = 120
×
59

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

65
        self.origInputsPos = [[w - delta, 0]]
1✔
66
        self.origOutputsPos = [[delta, 0]]
1✔
67

68
        self.outputs[0].setPos(
1✔
69
            self.origOutputsPos[0][0], self.origOutputsPos[0][1]
70
        )
71
        self.inputs[0].setPos(
1✔
72
            self.origInputsPos[0][0], self.origInputsPos[0][1]
73
        )
74

75
        self.updateFlipStateH(self.flippedH)
1✔
76
        self.updateFlipStateV(self.flippedV)
1✔
77

78
        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