From 106d7a7f472587108ca8892d2c112b844edc6dad Mon Sep 17 00:00:00 2001 From: Arthur Lu Date: Wed, 27 Jan 2021 04:08:27 +0000 Subject: [PATCH] fixed depreciated escape sequences --- analysis-master/tra_analysis/__init__.py | 4 +- .../parser/Hybrid_Utils/ExpressionCore.py | 40 +++++++++---------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/analysis-master/tra_analysis/__init__.py b/analysis-master/tra_analysis/__init__.py index af00cc72..78902773 100644 --- a/analysis-master/tra_analysis/__init__.py +++ b/analysis-master/tra_analysis/__init__.py @@ -25,11 +25,11 @@ __author__ = ( __all__ = [ ] -from . import Analysis +from . import Analysis as Analysis from .Array import Array from .ClassificationMetric import ClassificationMetric from . import CorrelationTest -from . import Equation +from .equation import Expression from . import Fit from . import KNN from . import NaiveBayes diff --git a/analysis-master/tra_analysis/equation/parser/Hybrid_Utils/ExpressionCore.py b/analysis-master/tra_analysis/equation/parser/Hybrid_Utils/ExpressionCore.py index be4d4e0d..f45de197 100644 --- a/analysis-master/tra_analysis/equation/parser/Hybrid_Utils/ExpressionCore.py +++ b/analysis-master/tra_analysis/equation/parser/Hybrid_Utils/ExpressionCore.py @@ -157,56 +157,56 @@ class Core(): unary_ops = {} ops = {} functions = {} - smatch = re.compile("\s*,") - vmatch = re.compile("\s*" + smatch = re.compile(r"\s*,") + vmatch = re.compile(r"\s*" "(?:" "(?P" "(?P[+-]?)" - "\s*0o" + r"\s*0o" "(?P[0-7]+)" ")|(?P" "(?P[+-]?)" - "\s*0x" + r"\s*0x" "(?P[0-9a-fA-F]+)" ")|(?P" "(?P[+-]?)" - "\s*0b" + r"\s*0b" "(?P[01]+)" ")|(?P" "(?P[+-]?)" - "\s*" - "(?P(?:\d+\.\d+|\d+\.|\.\d+|\d+))" + r"\s*" + r"(?P(?:\d+\.\d+|\d+\.|\.\d+|\d+))" "(?:" "[Ee]" - "(?P[+-]?\d+)" + r"(?P[+-]?\d+)" ")?" "(?:" - "\s*" - "(?P(?(rvalue)\+|))?" - "\s*" + r"\s*" + r"(?P(?(rvalue)\+|))?" + r"\s*" "(?P(?(rvalue)(?(sep)[+-]?|[+-])|[+-]?)?)" - "\s*" - "(?P(?:\d+\.\d+|\d+\.|\.\d+|\d+))" + r"\s*" + r"(?P(?:\d+\.\d+|\d+\.|\.\d+|\d+))" "(?:" "[Ee]" - "(?P[+-]?\d+)" + r"(?P[+-]?\d+)" ")?" "[ij]" ")?" ")" ")") - nmatch = re.compile("\s*([a-zA-Z_][a-zA-Z0-9_]*)") - gsmatch = re.compile('\s*(\()') - gematch = re.compile('\s*(\))') + nmatch = re.compile(r"\s*([a-zA-Z_][a-zA-Z0-9_]*)") + gsmatch = re.compile(r'\s*(\()') + gematch = re.compile(r'\s*(\))') def recalculateFMatch(self): fks = sorted(self.functions.keys(), key=len, reverse=True) oks = sorted(self.ops.keys(), key=len, reverse=True) uks = sorted(self.unary_ops.keys(), key=len, reverse=True) - self.fmatch = re.compile('\s*(' + '|'.join(map(re.escape,fks)) + ')') - self.omatch = re.compile('\s*(' + '|'.join(map(re.escape,oks)) + ')') - self.umatch = re.compile('\s*(' + '|'.join(map(re.escape,uks)) + ')') + self.fmatch = re.compile(r'\s*(' + '|'.join(map(re.escape,fks)) + ')') + self.omatch = re.compile(r'\s*(' + '|'.join(map(re.escape,oks)) + ')') + self.umatch = re.compile(r'\s*(' + '|'.join(map(re.escape,uks)) + ')') def addFn(self,id,str,latex,args,func): self.functions[id] = {