spectre.tools.CharmSimplifyTraces

Functions

extract_first_template_parameter(string)

Extract the first template parameter from a string

generic_replacements(text)

Apply generic naming replacements for Chares and entry methods.

user_replacements(text, json_replacements)

Apply user replacements from a JSON file.

spectre.tools.CharmSimplifyTraces.extract_first_template_parameter(string)

Extract the first template parameter from a string

Assume you have the string passed in is:

A<1, B<2, 4>, 3>, C, D, E<7, 8, F<9>>

We want to extract:

A<1, B<2, 4>, 3>

To do this we count the depth of the angle brackets and stop when we get to the first comma where we have zero angle brackets.

spectre.tools.CharmSimplifyTraces.generic_replacements(text)

Apply generic naming replacements for Chares and entry methods.

spectre.tools.CharmSimplifyTraces.user_replacements(text, json_replacements)

Apply user replacements from a JSON file.

First basic textual replacements are performed, followed by regular expression replacements.