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

SpiNNakerManchester / SpiNNMan / 6574804013

19 Oct 2023 12:47PM UTC coverage: 51.937% (+1.2%) from 50.777%
6574804013

Pull #327

github

Christian-B
typing changes
Pull Request #327: Type Annotations and Checking

105 of 1288 branches covered (0.0%)

Branch coverage included in aggregate %.

2375 of 2375 new or added lines in 180 files covered. (100.0%)

4775 of 8108 relevant lines covered (58.89%)

0.59 hits per line

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

56.67
/spinnman/messages/scp/impl/iptag_get_info_response.py
1
# Copyright (c) 2014 The University of Manchester
2
#
3
# Licensed under the Apache License, Version 2.0 (the "License");
4
# you may not use this file except in compliance with the License.
5
# You may obtain a copy of the License at
6
#
7
#     https://www.apache.org/licenses/LICENSE-2.0
8
#
9
# Unless required by applicable law or agreed to in writing, software
10
# distributed under the License is distributed on an "AS IS" BASIS,
11
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
# See the License for the specific language governing permissions and
13
# limitations under the License.
14

15
import struct
1✔
16
from spinn_utilities.overrides import overrides
1✔
17
from spinnman.messages.scp.abstract_messages import AbstractSCPResponse
1✔
18
from spinnman.messages.scp.enums import SCPResult
1✔
19
from spinnman.exceptions import SpinnmanUnexpectedResponseCodeException
1✔
20

21
_BYTE_SKIP_BYTE_BYTE = struct.Struct("<Bx2B")
1✔
22

23

24
class IPTagGetInfoResponse(AbstractSCPResponse):
1✔
25
    """
26
    An SCP response to a request for information about IP tags.
27
    """
28
    __slots__ = (
1✔
29
        "_fixed_size",
30
        "_pool_size",
31
        "_tto")
32

33
    def __init__(self) -> None:
1✔
34
        super().__init__()
×
35
        self._tto = 0
×
36
        self._pool_size = 0
×
37
        self._fixed_size = 0
×
38

39
    @overrides(AbstractSCPResponse.read_data_bytestring)
1✔
40
    def read_data_bytestring(self, data: bytes, offset: int):
1✔
41
        result = self.scp_response_header.result
×
42
        if result != SCPResult.RC_OK:
×
43
            raise SpinnmanUnexpectedResponseCodeException(
×
44
                "Get IP Tag Info", "CMD_IPTAG", result.name)
45

46
        self._tto, self._pool_size, self._fixed_size = \
×
47
            _BYTE_SKIP_BYTE_BYTE.unpack_from(data, offset)
48

49
    @property
1✔
50
    def transient_timeout(self) -> int:
1✔
51
        """
52
        The timeout for transient IP tags (i.e. responses to SCP commands).
53

54
        :rtype: int
55
        """
56
        return self._tto
×
57

58
    @property
1✔
59
    def pool_size(self) -> int:
1✔
60
        """
61
        The count of the IP tag pool size.
62

63
        :rtype: int
64
        """
65
        return self._pool_size
×
66

67
    @property
1✔
68
    def fixed_size(self) -> int:
1✔
69
        """
70
        The count of the number of fixed IP tag entries.
71

72
        :rtype: int
73
        """
74
        return self._fixed_size
×
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

© 2025 Coveralls, Inc