Skip to content
This repository has been archived by the owner on Jun 21, 2023. It is now read-only.

Commit

Permalink
Minor updates to documentation
Browse files Browse the repository at this point in the history
Main one is to allow newer versions of Sphinx to be used.
  • Loading branch information
dkfellows committed Dec 3, 2020
1 parent 9b24c09 commit dd9916b
Show file tree
Hide file tree
Showing 6 changed files with 164 additions and 43 deletions.
49 changes: 25 additions & 24 deletions data_specification/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,50 +16,51 @@
""" Used to generate memory images for a SpiNNaker CPU core from a set of \
instructions.
The main part of this package is the \
:py:class:`DataSpecificationGenerator` \
class. This is used to generate a "Data Specification", which can then be \
executed to produce a memory image. This package also handles this function \
if required, through the \
The main part of this package is the
:py:class:`DataSpecificationGenerator`
class. This is used to generate a "Data Specification", which can then be
executed to produce a memory image. This package also handles this function
if required, through the
:py:class:`DataSpecificationExecutor` class.
Functional Requirements
=======================
Creation of a Data Specification Language file which can be executed to \
Creation of a Data Specification Language file which can be executed to
produce a memory image.
* Any errors that can be checked during the creation of the \
specification should throw an exception.
* Any errors that can be checked during the creation of the specification
should throw an exception.
* It will be impossible to detect all errors at creation time.
* It will be impossible to detect all errors at creation time.
* There should be no assumption of where the data specification will \
be stored, although a default provision of a way to write the \
specification to a file is acceptable.
* There should be no assumption of where the data specification will be
stored, although a default provision of a way to write the specification to
a file is acceptable.
Execution of a Data Specification Language file, producing a memory image.
* This should detect any errors during execution and report them, \
halting the execution.
* This should detect any errors during execution and report them, halting the
execution.
* There should be no assumption of where the data specification is \
read from, although a default provision of a way to read the \
specification from a file is acceptable.
* There should be no assumption of where the data specification is read from,
although a default provision of a way to read the specification from a file
is acceptable.
Use Cases
=========
There are a number of use-cases of this library:
* :py:class:`DataSpecificationGenerator` \
is used to create a compressed memory image which can be expanded later, \
to reduce the amount of data that needs to be transferred over a slow \
connection.
* :py:class:`DataSpecificationGenerator` is used to create a compressed memory
image which can be expanded later, to reduce the amount of data that needs
to be transferred over a slow connection.
* :py:class:`DataSpecificationExecutor` \
is used to execute a previously generated specification at the receiving \
end of a slow connection.
* :py:class:`DataSpecificationExecutor` is used to execute a previously
generated specification at the receiving end of a slow connection.
Main API
========
"""
from data_specification._version import ( # noqa
__version__, __version_name__, __version_month__, __version_year__)
Expand Down
4 changes: 4 additions & 0 deletions data_specification/data_specification_executor_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@
class DataSpecificationExecutorFunctions(AbstractExecutorFunctions):
""" This class includes the function related to each of the commands\
of the data specification file.
.. note::
DSG operations not mentioned in this class will cause an error during
DSE if used.
"""

__slots__ = [
Expand Down
17 changes: 10 additions & 7 deletions data_specification/data_specification_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -2379,10 +2379,11 @@ def _write_command_to_files(self, cmd_word_list, cmd_string, indent=False,
outdent=False, no_instruction_number=False):
""" Writes the binary command to the binary output file and, if the\
user has requested a text output for debug purposes, also write\
the text version to the text file.\
Setting the optional parameter ``indent`` to True causes\
subsequent commands to be indented by two spaces relative to this\
one. Similarly, setting ``outdent`` to True, reverses this spacing.
the text version to the text file.
Setting the optional parameter ``indent`` to ``True`` causes subsequent
commands to be indented by two spaces relative to this one. Similarly,
setting ``outdent`` to ``True`` reverses this spacing.
:param bytearray cmd_word_list: list of binary words to be added to
the binary data specification file
Expand Down Expand Up @@ -2420,8 +2421,10 @@ def _write_command_to_files(self, cmd_word_list, cmd_string, indent=False,

@property
def region_sizes(self):
""" A list of sizes of each region that has been reserved. Note that\
the list will include 0s for each non-reserved region.
""" A list of sizes of each region that has been reserved.
.. note::
The list will include ``0`` for each non-reserved region.
:rtype: list(int)
"""
Expand All @@ -2430,7 +2433,7 @@ def region_sizes(self):
@property
def current_region(self):
""" The ID of the current DSG region we're writing to.\
If not yet writing to any region, None.
If not yet writing to any region, ``None``.
:rtype: int or None
"""
Expand Down
Loading

0 comments on commit dd9916b

Please sign in to comment.