Skip to content

Commit

Permalink
merged in master
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian-B committed Oct 18, 2023
2 parents de6b770 + 634b118 commit ef6d1d3
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 18 deletions.
2 changes: 1 addition & 1 deletion spinn_machine/chip.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
23 changes: 12 additions & 11 deletions spinn_machine/json_machine.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,14 @@ def _int_value(value):
return JAVA_MAX_INT


def _describe_chip(chip, std, eth):
# pylint: disable=wrong-spelling-in-docstring
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()
Expand All @@ -164,25 +165,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:
Expand Down
18 changes: 12 additions & 6 deletions spinn_machine/version/abstract_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__ = [
Expand Down Expand Up @@ -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:
"""
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit ef6d1d3

Please sign in to comment.