• 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

72.73
/spinnman/extended/read_adc.py
1
# Copyright (c) 2015 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
from spinn_utilities.overrides import overrides
1✔
16
from spinnman.messages.scp import SCPRequestHeader
1✔
17
from spinnman.messages.scp.abstract_messages import (
1✔
18
    AbstractSCPRequest, BMPRequest, BMPResponse)
19
from spinnman.messages.scp.enums import BMPInfo, SCPCommand
1✔
20
from spinnman.model import ADCInfo
1✔
21

22

23
class ReadADC(BMPRequest['_SCPReadADCResponse']):
1✔
24
    """
25
    SCP Request for the data from the BMP including voltages and
26
    temperature.
27

28
    This class is currently deprecated and untested as there is no
29
    known use except for Transceiver.read_adc_data which is itself
30
    deprecated.
31

32
    .. note::
33
        The equivalent code in Java is *not* deprecated.
34
    """
35
    __slots__ = ()
1✔
36

37
    def __init__(self, board: int):
1✔
38
        """
39
        :param int board: which board to request the ADC data from
40
        """
41
        super().__init__(
×
42
            board,
43
            SCPRequestHeader(command=SCPCommand.CMD_BMP_INFO),
44
            argument_1=BMPInfo.ADC.value)
45

46
    @overrides(AbstractSCPRequest.get_scp_response)
1✔
47
    def get_scp_response(self) -> '_SCPReadADCResponse':
1✔
48
        return _SCPReadADCResponse()
×
49

50

51
class _SCPReadADCResponse(BMPResponse[ADCInfo]):
1✔
52
    """
53
    An SCP response to a request for ADC information.
54
    """
55
    __slots__ = ("_adc_info", )
1✔
56

57
    def __init__(self) -> None:
1✔
58
        super().__init__("Read ADC", SCPCommand.CMD_BMP_INFO)
×
59
        self._adc_info = None
×
60

61
    def _parse_payload(self, data: bytes, offset: int) -> ADCInfo:
1✔
62
        return ADCInfo(data, offset)
×
63

64
    @property
1✔
65
    def adc_info(self):
1✔
66
        """
67
        The ADC information.
68
        """
69
        return self._value
×
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