Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian-B committed Jan 19, 2024
1 parent a3f00c5 commit f1f5c90
Show file tree
Hide file tree
Showing 7 changed files with 83 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pylint.bash
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@ cat "../SupportScripts/actions/pylint/default_dict.txt" >$dict
cat ".pylint_dict.txt" >>$dict

# pylint --output-format=colorized --disable=R --persistent=no --jobs=1 --rcfile=../SupportScripts/actions/pylint/strict_rcfile --spelling-dict=en_GB --spelling-private-dict-file=$dict --disable=import-error spinnman
pylint --enable=invalid-name --output-format=colorized --disable=R --persistent=no --jobs=1 --rcfile=../SupportScripts/actions/pylint/strict_rcfile --spelling-dict=en_GB --spelling-private-dict-file=$dict --disable=all spinnman
pylint --enable=missing-function-docstring --output-format=colorized --disable=R --persistent=no --jobs=1 --rcfile=../SupportScripts/actions/pylint/strict_rcfile --spelling-dict=en_GB --spelling-private-dict-file=$dict --disable=all spinnman

3 changes: 2 additions & 1 deletion spinnman/extended/extended_transceiver.py
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,8 @@ def free_sdram_by_app_id(self, x, y, app_id):
logger.info(self.where_is_xy(x, y))
raise

def get_router_diagnostic_filter(self, x, y, position):
def get_router_diagnostic_filter(
self, x: int, y: int, position: int) -> DiagnosticFilter:
"""
Gets a router diagnostic filter from a router.
Expand Down
5 changes: 5 additions & 0 deletions spinnman/messages/scp/enums/signal.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,9 @@ def __init__(self, value: int, signal_type: SignalType) -> None:

@property
def signal_type(self) -> SignalType:
"""
The "type" of the signal
:rtype: SignalType
"""
return self._signal_type
5 changes: 5 additions & 0 deletions spinnman/messages/scp/impl/fixed_route_read.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ def read_data_bytestring(self, data: bytes, offset: int):

@property
def route(self) -> FixedRouteEntry:
"""
Converts this reponse into a Route
:rtype: FixedRouteEntry
"""
processor_ids: List[int] = list()
for processor_id in range(26):
if self._route & (1 << (6 + processor_id)) != 0:
Expand Down
5 changes: 5 additions & 0 deletions spinnman/messages/sdp/sdp_header.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,11 @@ def from_bytestring(data: bytes, offset: int):
source_chip_x, source_chip_y)

def get_physical_cpu_id(self) -> str:
"""
A String describing the physical core of the destination.
:rtype: str
"""
if SpiNNManDataView.has_machine():
chip = SpiNNManDataView.get_machine().get_chip_at(
self._destination_chip_x, self._destination_chip_y)
Expand Down
18 changes: 15 additions & 3 deletions spinnman/messages/spinnaker_boot/system_variable_boot_values.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.

import struct
from typing import NamedTuple, Union, Optional
from typing import Any, NamedTuple, Union, Optional
from enum import Enum

_SYSTEM_VARIABLES_BOOT_SIZE = 128
Expand Down Expand Up @@ -359,11 +359,23 @@ def __init__(self):
for variable in SystemVariableDefinition:
self._values[variable] = variable.default

def set_value(self, system_variable_definition, value):
def set_value(self, system_variable_definition: SystemVariableDefinition,
value: Any):
"""
:param system_variable_definition:
:param value:
:return:
"""
self._values[system_variable_definition] = value

@property
def bytestring(self):
def bytestring(self) -> bytes:
"""
Gets all the SystemVariableDefinition as bytes
:rtype: bytes
"""
data = b""
for sys_var in SystemVariableDefinition:
data += struct.pack(sys_var.data_type.struct_code,
Expand Down
50 changes: 50 additions & 0 deletions spinnman/model/diagnostic_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,36 +129,78 @@ def __init__(self, enable_interrupt_on_counter_event: bool,

@property
def enable_interrupt_on_counter_event(self) -> bool:
"""
Returns the enable interrupt on counter event passed into
the init unchanged
Currently unused
"""
return self._enable_interrupt_on_counter_event

@property
def match_emergency_routing_status_to_incoming_packet(self) -> bool:
"""
Returns the match emergency routing status to incoming packet passed
into the init unchanged
Currently unused
"""
return self._match_emergency_routing_status_to_incoming_packet

@property
def destinations(self) -> List[DiagnosticFilterDestination]:
"""
Returns the destinations passed into the init unchanged
Currently unused
"""
return self._destinations

@property
def sources(self) -> List[DiagnosticFilterSource]:
"""
Returns the sources passed into the init unchanged
Currently unused
"""
return self._sources

@property
def payload_statuses(self) -> List[DiagnosticFilterPayloadStatus]:
"""
Returns the payload statuses passed into the init unchanged
Currently unused
"""
return self._payload_statuses

@property
def default_routing_statuses(self) -> List[
DiagnosticFilterDefaultRoutingStatus]:
"""
Returns the default routing statuses passed into the init unchanged
Currently unused
"""
return self._default_routing_statuses

@property
def emergency_routing_statuses(self) -> List[
DiagnosticFilterEmergencyRoutingStatus]:
"""
Returns the emergency routing statuses passed into the init unchanged
Currently unused
"""
return self._emergency_routing_statuses

@property
def packet_types(self) -> List[DiagnosticFilterPacketType]:
"""
Returns the packet types passed into the init unchanged
Currently unused
"""
return self._packet_types

@property
Expand Down Expand Up @@ -194,6 +236,14 @@ def filter_word(self) -> int:

@staticmethod
def read_from_int(int_value: int) -> DiagnosticFilter:
"""
Claims to returns a filter that reads an int
Currently only called by unused Transceiver methods
:param int int_value:
:rtype: DiagnosticFilter
"""
enable_interrupt_on_counter_event = (
(int_value >> _ENABLE_INTERRUPT_OFFSET) & 0x1) == 1
match_emergency_routing_status_to_incoming_packet = (
Expand Down

0 comments on commit f1f5c90

Please sign in to comment.