Skip to content

Commit

Permalink
Solve invalid escape sequence
Browse files Browse the repository at this point in the history
  • Loading branch information
eivindjahren committed Jan 28, 2025
1 parent 249da8b commit 5fdf028
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions python/resdata/summary/rd_cmp.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@ def cmp_summary_vector(self, key, sample=100):
The comparison is based on evaluating the integrals:
I0 = \int R(t) dt
I0 = \\int R(t) dt
delta = \int | R(t) - T(t)| dt
delta = \\int | R(t) - T(t)| dt
numericall. R(t) is the reference solution and T(t) is
testcase solution. The return value is a tuple:
Expand Down
2 changes: 1 addition & 1 deletion python/resdata/summary/rd_npv.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def eval(self, date):


class ResdataNPV(object):
sumKeyRE = re.compile("[\[]([\w:,]+)[\]]")
sumKeyRE = re.compile(r"[\[]([\w:,]+)[\]]")

def __init__(self, baseCase):
sum = Summary(baseCase)
Expand Down
4 changes: 2 additions & 2 deletions python/resdata/summary/rd_sum.py
Original file line number Diff line number Diff line change
Expand Up @@ -1533,8 +1533,8 @@ def solve_days(self, key, value, rates_clamp_lower=True):
A B
| |
/|\ OPR | |
| \|/ \|/
^ OPR | |
| v v
|
| +============X
| | |
Expand Down
6 changes: 3 additions & 3 deletions python/resdata/util/test/source_enumerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class SourceEnumerator(object):
@classmethod
def removeComments(cls, code_string):
code_string = re.sub(
re.compile("/\*.*?\*/", re.DOTALL), "", code_string
re.compile(r"/\*.*?\*/", re.DOTALL), "", code_string
) # remove all occurance streamed comments (/*COMMENT */) from string
code_string = re.sub(
re.compile("//.*?\n"), "", code_string
Expand All @@ -20,7 +20,7 @@ def findEnum(cls, enum_name, full_source_file_path):

text = SourceEnumerator.removeComments(text)

enum_pattern = re.compile("typedef\s+enum\s+\{(.*?)\}\s*(\w+?);", re.DOTALL)
enum_pattern = re.compile(r"typedef\s+enum\s+\{(.*?)\}\s*(\w+?);", re.DOTALL)

for enum in enum_pattern.findall(text):
if enum[1] == enum_name:
Expand All @@ -32,7 +32,7 @@ def findEnum(cls, enum_name, full_source_file_path):
def findEnumerators(cls, enum_name, source_file):
enum_text = SourceEnumerator.findEnum(enum_name, source_file)

enumerator_pattern = re.compile("(\w+?)\s*?=\s*?(\d+)")
enumerator_pattern = re.compile(r"(\w+?)\s*?=\s*?(\d+)")

enumerators = []
for enumerator in enumerator_pattern.findall(enum_text):
Expand Down
2 changes: 1 addition & 1 deletion python/resdata/util/util/time_vector.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def __init__(self, default_value=None, initial_size=0):

@classmethod
def parseTimeUnit(cls, deltaString):
deltaRegexp = re.compile("(?P<num>\d*)(?P<unit>[dmy])", re.IGNORECASE)
deltaRegexp = re.compile(r"(?P<num>\d*)(?P<unit>[dmy])", re.IGNORECASE)
matchObj = deltaRegexp.match(deltaString)
if matchObj:
try:
Expand Down

0 comments on commit 5fdf028

Please sign in to comment.