Including remaining metric fixes from #251

Co-authored-by: Nick Curtis <nicholas.curtis@amd.com>
Signed-off-by: colramos-amd <colramos@amd.com>
Этот коммит содержится в:
colramos-amdиNick Curtis authored and Cole Ramos committed 2024-03-01 15:50:42 -06:00
1 родитель 86b6c8e848
Коммит 3ce140d04b
12 files changed
+106 -72

No files matched your search

+2 -2
Просмотреть файл
@@ -290,7 +290,7 @@ def build_eval_string(equation, coll_level):
# build-in variable starts with '$', python can not handle it.
# replace '$' with 'ammolite__'.
# TODO: pre-check there is no "ammolite__" in all config files.
s = re.sub("\$", "ammolite__", s)
s = re.sub(r"\$", "ammolite__", s)
# convert equation string to intermediate expression in df array format
ast_node = ast.parse(s)
@@ -304,7 +304,7 @@ def build_eval_string(equation, coll_level):
# the target is df['TCC_HIT[0]']
s = re.sub(r"\'\]\[(\d+)\]", r"[\g<1>]']", s)
# use .get() to catch any potential KeyErrors
s = re.sub("raw_pmc_df\['(.*?)']", r'raw_pmc_df.get("\1")', s)
s = re.sub(r"raw_pmc_df\['(.*?)']", r'raw_pmc_df.get("\1")', s)
# apply coll_level
s = re.sub(r"raw_pmc_df", "raw_pmc_df.get('" + coll_level + "')", s)
# print("--- build_eval_string, return: ", s)