spinn_machine.data package¶
Submodules¶
spinn_machine.data.machine_data_writer module¶
- class spinn_machine.data.machine_data_writer.MachineDataWriter(state: DataStatus)[source]¶
Bases:
UtilsDataWriter
,MachineDataView
See UtilsDataWriter.
This class is designed to only be used directly within the SpiNNMachine repository unit tests as all methods are available to subclasses.
- Parameters:
state (DataStatus) – State writer should be in
- clear_machine() None [source]¶
Clears any previously set machine.
Warning
Designed to only be used by ASB to remove a max machine before allocating an actual one. Any other use is not supported. Will be removed without notice if max_machine is no longer done.
- get_user_accessed_machine() bool [source]¶
Reports if …View.get_machine has been called outside of sim.run.
Designed to only be used from ASB. Any other use is not supported
Module contents¶
- class spinn_machine.data.MachineDataView¶
Bases:
UtilsDataView
Adds the extra Methods to the View for Machine level.
See
UtilsDataView
for a more detailed description.This class is designed to only be used directly within the SpiNNMachine repository as all methods are available to subclasses
- classmethod get_chip_at(x: int, y: int) Chip [source]¶
Gets the chip at (x, y).
Almost Semantic sugar for get_machine()[x, y]
The method however does not return None but rather raises a KeyError if the chip is not known
- Parameters:
- Return type:
- Raises:
SpiNNUtilsException – If the machine is currently unavailable
KeyError – If the chip does not exist but the machine does
- classmethod get_machine() Machine [source]¶
Returns the Machine if it has been set.
In Mock mode will create and return a virtual 8 * 8 board
- Raises:
SpiNNUtilsException – If the machine is currently unavailable
- Return type:
- classmethod get_machine_version() AbstractVersion [source]¶
Returns the Machine Version if it has or can be set.
` May call version_factory to create the version
- return:
A superclass of AbstractVersion
- raises SpinnMachineException:
If the cfg version is not set correctly
- classmethod get_nearest_ethernet(x: int, y: int) Tuple[int, int] [source]¶
Gets the nearest Ethernet-enabled chip (x, y) for the chip at (x, y) if it exists.
If there is no machine or no chip at (x, y) this method, or any other issue will just return (x, y)
Note
This method will never request a new machine. Therefore a call to this method will not trigger a hard reset
- classmethod has_existing_machine() bool [source]¶
Reports if a machine is currently already created.
Unlike has_machine this method returns false if a machine could be mocked
- Return type:
- classmethod has_machine() bool [source]¶
Reports if a machine is currently set or can be mocked.
Unlike has_existing_machine for unit tests this will return True even if a Machine has not yet been created
- Return type:
- classmethod where_is_chip(chip: Chip) str [source]¶
Gets a string saying where chip is if possible.
Almost Semantic sugar for get_machine().where_is_chip()
The method does not raise an exception rather returns a String of the exception
Note
This method will never request a new machine. Therefore a call to this method will not trigger a hard reset
- classmethod where_is_xy(x: int, y: int) str [source]¶
Gets a string saying where chip at x and y is if possible.
Almost Semantic sugar for get_machine().where_is_xy()
The method does not raise an exception rather returns a String of the exception
Note
This method will never request a new machine. Therefore a call to this method will not trigger a hard reset