• 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

60.0
/spinnman/extended/de_alloc_sdram_process.py
1

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

20

21
class DeAllocSDRAMProcess(AbstractMultiConnectionProcess):
1✔
22
    """
23
    .. warning::
24
        This class is currently deprecated and untested as there is no
25
        known use except for Transceiver.free_sdram and free_sdram_by_app_id
26
        which are both themselves deprecated.
27
    """
28
    __slots__ = ("_no_blocks_freed", )
1✔
29

30
    def __init__(self, connection_selector: ConnectionSelector):
1✔
31
        """
32
        :param ConnectionSelector connection_selector:
33
        """
34
        super().__init__(connection_selector)
×
35
        self._no_blocks_freed: Optional[int] = None
×
36

37
    def de_alloc_all_app_sdram(self, x: int, y: int, app_id: int):
1✔
38
        """
39
        :param int x:
40
        :param int y:
41
        :param int app_id:
42
        :param base_address:
43
        :type base_address: int or None
44
        """
45
        # deallocate space in the SDRAM
46
        with self._collect_responses():
×
47
            self._send_request(SDRAMDeAlloc(x, y, app_id=app_id),
×
48
                               callback=self.__handle_sdram_alloc_response)
49

50
    def de_alloc_sdram(self, x: int, y: int, base_address: int):
1✔
51
        """
52
        :param int x:
53
        :param int y:
54
        :param int base_address:
55
        """
56
        with self._collect_responses():
×
57
            self._send_request(SDRAMDeAlloc(x, y, base_address=base_address),
×
58
                               callback=None)
59

60
    def __handle_sdram_alloc_response(self, response):
1✔
61
        self._no_blocks_freed = response.number_of_blocks_freed
×
62

63
    @property
1✔
64
    def no_blocks_freed(self) -> Optional[int]:
1✔
65
        """
66
        :rtype: int
67
        """
68
        return self._no_blocks_freed
×
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