From 2d4a96c01a47e2ebf19d1993cd2aba5e6998760f Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Tue, 17 Oct 2023 10:50:11 +0100 Subject: [PATCH 1/5] use words for param names --- spinn_machine/json_machine.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/spinn_machine/json_machine.py b/spinn_machine/json_machine.py index a3a02535..4716ad1b 100644 --- a/spinn_machine/json_machine.py +++ b/spinn_machine/json_machine.py @@ -136,13 +136,13 @@ def _int_value(value): return JAVA_MAX_INT -def _describe_chip(chip, std, eth): +def _describe_chip(chip, standard, ethernet): """ Produce a JSON-suitable description of a single chip. :param chip: The chip to describe. - :param std: The standard chip resources. - :param eth: The standard Ethernet-enabled chip resources. + :param standard: The standard chip resources. + :param ethernet: The standard Ethernet-enabled chip resources. :return: Description of chip that is trivial to serialize as JSON. """ details = dict() @@ -164,25 +164,25 @@ def _describe_chip(chip, std, eth): if chip.ip_address is not None: details['ipAddress'] = chip.ip_address # Write the Resources ONLY if different from the e_values - if (chip.n_processors - chip.n_user_processors) != eth.monitors: + if (chip.n_processors - chip.n_user_processors) != ethernet.monitors: exceptions["monitors"] = \ chip.n_processors - chip.n_user_processors - if router_entries != eth.router_entries: + if router_entries != ethernet.router_entries: exceptions["routerEntries"] = router_entries - if chip.sdram != eth.sdram: + if chip.sdram != ethernet.sdram: exceptions["sdram"] = chip.sdram - if chip.tag_ids != eth.tags: + if chip.tag_ids != ethernet.tags: exceptions["tags"] = list(chip.tag_ids) else: # Write the Resources ONLY if different from the s_values - if (chip.n_processors - chip.n_user_processors) != std.monitors: + if (chip.n_processors - chip.n_user_processors) != standard.monitors: exceptions["monitors"] = \ chip.n_processors - chip.n_user_processors - if router_entries != std.router_entries: + if router_entries != standard.router_entries: exceptions["routerEntries"] = router_entries - if chip.sdram != std.sdram: + if chip.sdram != standard.sdram: exceptions["sdram"] = chip.sdram - if chip.tag_ids != std.tags: + if chip.tag_ids != standard.tags: exceptions["tags"] = list(chip.tag_ids) if exceptions: From 451e9c353b7d646fd5b35fddc5d972a34597136b Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Tue, 17 Oct 2023 10:58:39 +0100 Subject: [PATCH 2/5] wrong-spelling-in-docstring as speller wants SDRAM param name --- spinn_machine/chip.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spinn_machine/chip.py b/spinn_machine/chip.py index 17acb8ca..5521e301 100644 --- a/spinn_machine/chip.py +++ b/spinn_machine/chip.py @@ -39,7 +39,7 @@ class Chip(object): "_n_user_processors", "_parent_link", "_v_to_p_map" ) - # pylint: disable=too-many-arguments + # pylint: disable=too-many-arguments, wrong-spelling-in-docstring def __init__(self, x, y, n_processors, router, sdram, nearest_ethernet_x, nearest_ethernet_y, ip_address=None, tag_ids=None, down_cores=None, parent_link=None, From 46f1ad4d48a9129959dd2a5cbc586c730a4495aa Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Tue, 17 Oct 2023 10:58:59 +0100 Subject: [PATCH 3/5] fix docs --- spinn_machine/version/abstract_version.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/spinn_machine/version/abstract_version.py b/spinn_machine/version/abstract_version.py index 197427b7..3da10452 100644 --- a/spinn_machine/version/abstract_version.py +++ b/spinn_machine/version/abstract_version.py @@ -24,7 +24,13 @@ class AbstractVersion(object, metaclass=AbstractBase): """ - Properties for sa spec + Base class for the version classes. + + Version classes are the main way to create a Machine object of the + correct class. + + The version classes contain properties that will change depending + on the version. """ __slots__ = [ @@ -114,7 +120,7 @@ def number(self): @abstractproperty def board_shape(self): """ - The width and heigth of a single board of this type + The width and height of a single board of this type :return: """ @@ -143,12 +149,12 @@ def n_non_user_cores(self): @property def max_sdram_per_chip(self): """ - Gets the max sdram per chip for the whole system. + Gets the max SDRAM per chip for the whole system. - While it is likely that all Chips will have this sdram - this should not be counted on. Ask each Chip for its sdram. + While it is likely that all Chips will have this SDRAM + this should not be counted on. Ask each Chip for its SDRAM. - :return: the default sdram per chip + :return: the default SDRAM per chip :rtype: int """ return self._max_sdram_per_chip From 12c4e764fbd61393276586c130e701e43fb96b54 Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Tue, 17 Oct 2023 11:19:36 +0100 Subject: [PATCH 4/5] pylint want Ethernet --- spinn_machine/json_machine.py | 1 + 1 file changed, 1 insertion(+) diff --git a/spinn_machine/json_machine.py b/spinn_machine/json_machine.py index 4716ad1b..77c0cf7a 100644 --- a/spinn_machine/json_machine.py +++ b/spinn_machine/json_machine.py @@ -136,6 +136,7 @@ def _int_value(value): return JAVA_MAX_INT +# pylint: wrong-spelling-in-docstring def _describe_chip(chip, standard, ethernet): """ Produce a JSON-suitable description of a single chip. From 3b93d1b9292ab328689b8d0a9cb45174e76b209c Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Tue, 17 Oct 2023 11:25:47 +0100 Subject: [PATCH 5/5] pylint want Ethernet disabled correctly --- spinn_machine/json_machine.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spinn_machine/json_machine.py b/spinn_machine/json_machine.py index 77c0cf7a..5ffabad9 100644 --- a/spinn_machine/json_machine.py +++ b/spinn_machine/json_machine.py @@ -136,7 +136,7 @@ def _int_value(value): return JAVA_MAX_INT -# pylint: wrong-spelling-in-docstring +# pylint: disable=wrong-spelling-in-docstring def _describe_chip(chip, standard, ethernet): """ Produce a JSON-suitable description of a single chip.