From 8112f87d395e7a4a142f5134c31f6c83407404cd Mon Sep 17 00:00:00 2001 From: Daniel Otto de Mentock Date: Mon, 28 Nov 2022 10:33:07 +0100 Subject: [PATCH] parameter names can contain underscores --- python/damask/util.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/damask/util.py b/python/damask/util.py index bda92b732..f1fd08392 100644 --- a/python/damask/util.py +++ b/python/damask/util.py @@ -567,7 +567,7 @@ def _docstringer(docstring: _Union[str, _Callable], shift = min([len(line)-len(line.lstrip(' '))-indent for line in content]) extra = '\n'.join([(line[shift:] if shift > 0 else f'{" "*-shift}{line}') for line in content]) - docstring_ = _re.sub(fr'(^([ ]*){key}\s*\n\2{"-"*len(key)}[\n ]*[A-Za-z0-9 ]*: ([^\n]+\n)*)', + docstring_ = _re.sub(fr'(^([ ]*){key}\s*\n\2{"-"*len(key)}[\n ]*[A-Za-z0-9_ ]*: ([^\n]+\n)*)', fr'\1{extra}\n', docstring_,flags=_re.MULTILINE) @@ -583,7 +583,7 @@ def _docstringer(docstring: _Union[str, _Callable], +(return_class.__name__ if not isinstance(return_class,str) else return_class) ) - return _re.sub(r'(^([ ]*)Returns\s*\n\2-------\s*\n[ ]*[A-Za-z0-9 ]*: )(.*)\n', + return _re.sub(r'(^([ ]*)Returns\s*\n\2-------\s*\n[ ]*[A-Za-z0-9_ ]*: )(.*)\n', fr'\1{return_type_}\n', docstring_,flags=_re.MULTILINE)