append_f function

(Shortest import: from brian2cuda.utils import append_f)

brian2cuda.utils.stringtools.append_f(match)[source]

Append 'f' to the string in match if it doesn’t end with 'f'. Used in replace_floating_point_literals.

Parameters:

match : re.MatchObject

The return type of e.g. re.match or re.search.

Returns:

str :

The string returned from match.group() if it end with 'f', else the string with 'f' appended.