spinn_utilities.make_tools package

Submodules

spinn_utilities.make_tools.converter module

class spinn_utilities.make_tools.converter.Converter(src, dest, dict_file)[source]

Bases: object

Converts a whole directory including sub directories

Parameters:
  • src (str) – Full source directory
  • dest (str) – Full destination directory
  • dict_file (str) – Full path to dictionary file
static convert(src, dest, dict_file)[source]
run()[source]

Runs the file converter on a whole directory including sub directories

WARNING. This code is absolutely not thread safe. Interwoven calls even on different FileConverter objects is dangerous! It is highly likely that dict files become corrupted and the same message_id is used multiple times.

Returns:

spinn_utilities.make_tools.file_converter module

class spinn_utilities.make_tools.file_converter.FileConverter(src, dest, dict_file)[source]

Bases: object

Creates the file_convertor to convert one file

Parameters:
  • src (str) – Full source directory
  • dest (str) – Full destination directory
  • dict_file (str) – File to hold dictionary mappings
bracket_count(text)[source]
static convert(src, dest, dict_file, range_start)[source]

Static method to create Object and do the conversion

Parameters:
  • src (str) – Full source directory
  • dest (str) – Full destination directory
  • dict_file (str) – File to hold dictionary mappings
  • range_start (int) –
  • range_start – id of last dictionary key used
Returns:

The last message id use which can in turn be passed into

quote_part(text)[source]
split_by_comma_plus(main, line_num)[source]
unique_src()[source]

Returns the part of the source path which is different

For example assuming a source of /spinnaker/sPyNNaker/neural_modelling/src/common/in_spikes.h /spinnaker/sPyNNaker/neural_modelling/modified_src/common/in_spikes.h returns src/common/in_spikes.h

Returns:A pointer to the source relative to the destination

spinn_utilities.make_tools.replacer module

class spinn_utilities.make_tools.replacer.Replacer(dict_pointer)[source]

Bases: object

hex_to_float(hex_str)[source]
hexes_to_double(upper, lower)[source]
replace(short)[source]

Module contents

class spinn_utilities.make_tools.FileConverter(src, dest, dict_file)[source]

Bases: object

Creates the file_convertor to convert one file

Parameters:
  • src (str) – Full source directory
  • dest (str) – Full destination directory
  • dict_file (str) – File to hold dictionary mappings
bracket_count(text)[source]
static convert(src, dest, dict_file, range_start)[source]

Static method to create Object and do the conversion

Parameters:
  • src (str) – Full source directory
  • dest (str) – Full destination directory
  • dict_file (str) – File to hold dictionary mappings
  • range_start (int) –
  • range_start – id of last dictionary key used
Returns:

The last message id use which can in turn be passed into

quote_part(text)[source]
split_by_comma_plus(main, line_num)[source]
unique_src()[source]

Returns the part of the source path which is different

For example assuming a source of /spinnaker/sPyNNaker/neural_modelling/src/common/in_spikes.h /spinnaker/sPyNNaker/neural_modelling/modified_src/common/in_spikes.h returns src/common/in_spikes.h

Returns:A pointer to the source relative to the destination