implement action replay for vscode and gimp evaluation
This commit is contained in:
@@ -1,11 +1,8 @@
|
||||
def compare_text_file(actual: str, expected: str, **options) -> float:
|
||||
"""
|
||||
Args:
|
||||
actual (str): path to result xlsx
|
||||
expected (str): path to gold xlsx
|
||||
options (Dict[str, List[str]]): dict like
|
||||
{
|
||||
}
|
||||
actual (str): path to result text file
|
||||
expected (str): path to gold text file
|
||||
|
||||
Return:
|
||||
float: the score
|
||||
@@ -20,7 +17,32 @@ def compare_text_file(actual: str, expected: str, **options) -> float:
|
||||
return 1.0
|
||||
return 0.0
|
||||
|
||||
def compare_config(actual: str, expected: str, **options) -> float:
|
||||
"""
|
||||
Args:
|
||||
actual (str): path to result text file
|
||||
expected (str): gold string
|
||||
|
||||
Return:
|
||||
float: the score
|
||||
"""
|
||||
|
||||
with open(actual) as f1:
|
||||
actual_text = f1.read()
|
||||
|
||||
if actual_text == expected:
|
||||
return 1.0
|
||||
return 0.0
|
||||
|
||||
def compare_answer(actual: str, expected: str, **options) -> float:
|
||||
"""
|
||||
Args:
|
||||
actual (str): result string
|
||||
expected (str): gold string
|
||||
|
||||
Return:
|
||||
float: the score
|
||||
"""
|
||||
|
||||
if actual == expected:
|
||||
return 1.0
|
||||
|
||||
Reference in New Issue
Block a user