fix gds name mangling in cases with fractional dose

This commit is contained in:
jan 2016-10-19 16:59:20 -07:00
parent 103e72628c
commit d355d84f6d

View File

@ -19,9 +19,9 @@ def mangle_name(pattern: Pattern, dose_multiplier: float=1.0) -> str:
:return: Mangled name. :return: Mangled name.
""" """
expression = re.compile('[^A-Za-z0-9_\?\$]') expression = re.compile('[^A-Za-z0-9_\?\$]')
sanitized_name = expression.sub('_', pattern.name) full_name = '{}_{}_{}'.format(pattern.name, dose_multiplier, id(pattern))
full_name = '{}_{}_{}'.format(sanitized_name, dose_multiplier, id(pattern)) sanitized_name = expression.sub('_', full_name)
return full_name return sanitized_name
def make_dose_table(pattern: Pattern, dose_multiplier: float=1.0) -> Set[Tuple[int, float]]: def make_dose_table(pattern: Pattern, dose_multiplier: float=1.0) -> Set[Tuple[int, float]]: