• 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

77.5
/trnsysGUI/IceStorageTwoHx.py
1
# pylint: skip-file
2

3

4
import typing as _tp
1✔
5

6
import trnsysGUI.images as _img
1✔
7
import trnsysGUI.internalPiping as _ip
1✔
8
import trnsysGUI.massFlowSolver.networkModel as _mfn
1✔
9
from trnsysGUI.BlockItemFourPorts import BlockItemFourPorts
1✔
10

11

12
class IceStorageTwoHx(BlockItemFourPorts):
1✔
13
    def __init__(self, trnsysType: str, editor, displayName: str) -> None:
1✔
14
        super().__init__(trnsysType, editor, displayName)
1✔
15

16
        self.changeSize()
1✔
17

18
    @classmethod
1✔
19
    @_tp.override
1✔
20
    def _getImageAccessor(
1✔
21
        cls,
22
    ) -> _img.SvgImageAccessor:  # pylint: disable=arguments-differ
UNCOV
23
        return _img.ICE_STORAGE_TWO_HX_SVG
×
24

25
    def changeSize(self):
1✔
26
        w = self.w
1✔
27
        h = self.h
1✔
28

29
        """ Resize block function """
1✔
30
        delta = 20
1✔
31

32
        # center label:
33
        rect = self.label.boundingRect()
1✔
34
        lw, lh = rect.width(), rect.height()
1✔
35
        lx = (w - lw) / 2
1✔
36
        self.label.setPos(lx, h)
1✔
37

38
        self.origInputsPos = [[0, delta], [w, delta]]
1✔
39
        self.origOutputsPos = [[0, h - delta], [w, h - delta]]
1✔
40
        self.inputs[0].setPos(
1✔
41
            self.origInputsPos[0][0], self.origInputsPos[0][1]
42
        )
43
        self.inputs[1].setPos(
1✔
44
            self.origInputsPos[1][0], self.origInputsPos[1][1]
45
        )
46
        self.outputs[0].setPos(
1✔
47
            self.origOutputsPos[0][0], self.origOutputsPos[0][1]
48
        )
49
        self.outputs[1].setPos(
1✔
50
            self.origOutputsPos[1][0], self.origOutputsPos[1][1]
51
        )
52

53
        self.updateFlipStateH(self.flippedH)
1✔
54
        self.updateFlipStateV(self.flippedV)
1✔
55

56
        return w, h
1✔
57

58
    def getInternalPiping(self) -> _ip.InternalPiping:
1✔
59
        side1Input = _mfn.PortItem("In", _mfn.PortItemDirection.INPUT)
×
60
        side1Output = _mfn.PortItem("Out", _mfn.PortItemDirection.OUTPUT)
×
61
        side1Pipe = _mfn.Pipe(side1Input, side1Output, "Left")
×
62

63
        side2Input = _mfn.PortItem("In", _mfn.PortItemDirection.INPUT)
×
64
        side2Output = _mfn.PortItem("Out", _mfn.PortItemDirection.OUTPUT)
×
65
        side2Pipe = _mfn.Pipe(side2Input, side2Output, "Right")
×
66

67
        modelPortItemsToGraphicalPortItem = {
×
68
            side1Input: self.inputs[0],
69
            side1Output: self.outputs[0],
70
            side2Input: self.inputs[1],
71
            side2Output: self.outputs[1],
72
        }
73

NEW
74
        return _ip.InternalPiping(
×
75
            [side1Pipe, side2Pipe], modelPortItemsToGraphicalPortItem
76
        )
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