Skip to content

Commit

Permalink
Merge pull request #143 from efabless/string-deprec
Browse files Browse the repository at this point in the history
Convert to raw strings  to remove deprecation warning
  • Loading branch information
mole99 authored Jan 14, 2025
2 parents 2bad273 + 452c05b commit b5b9b31
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 16 deletions.
6 changes: 6 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# 2.5.5

## Common

- Convert to raw strings to remove deprecation warning

# 2.5.4

## Common
Expand Down
2 changes: 1 addition & 1 deletion cace/__version__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
__version__ = '2.5.4'
__version__ = '2.5.5'

if __name__ == '__main__':
print(__version__, end='')
10 changes: 5 additions & 5 deletions cace/common/cace_read.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,19 +118,19 @@ def cace_read(filename, debug=False):

# Define regular expressions for parsing
# Simple key:value entries
kvrex = re.compile('^[ \t]*([^: \t]+)[ \t]*:[ \t]+(.*)$')
kvrex = re.compile(r'^[ \t]*([^: \t]+)[ \t]*:[ \t]+(.*)$')

# Key:dictionary entries
kdrex = re.compile('^[ \t]*([^ \t\{]+)[ \t]*\{[ \t]*(.*)$')
kdrex = re.compile(r'^[ \t]*([^ \t\{]+)[ \t]*\{[ \t]*(.*)$')

# New list-of-dictionaries entry
listrex = re.compile('^[ \t]*\+[ \t]*(.*)$')
listrex = re.compile(r'^[ \t]*\+[ \t]*(.*)$')

# End of dictionary
endrex = re.compile('^[ \t]*\}[ \t]*$')
endrex = re.compile(r'^[ \t]*\}[ \t]*$')

# End of list
lendrex = re.compile('^[ \t]*\][ \t]*$')
lendrex = re.compile(r'^[ \t]*\][ \t]*$')

# Now split into lines
for line in clines.splitlines():
Expand Down
18 changes: 9 additions & 9 deletions cace/common/cace_regenerate.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ def printwarn(output):
if not output:
return 0

failrex = re.compile('.*failure', re.IGNORECASE)
warnrex = re.compile('.*warning', re.IGNORECASE)
errrex = re.compile('.*error', re.IGNORECASE)
missrex = re.compile('.*not found', re.IGNORECASE)
failrex = re.compile(r'.*failure', re.IGNORECASE)
warnrex = re.compile(r'.*warning', re.IGNORECASE)
errrex = re.compile(r'.*error', re.IGNORECASE)
missrex = re.compile(r'.*not found', re.IGNORECASE)

errors = 0
outlines = output.splitlines()
Expand Down Expand Up @@ -124,7 +124,7 @@ def check_layout_out_of_date(spicepath, layoutpath, debug=False):
)
layoutdir = os.path.split(layoutpath)[0]
subrex = re.compile(
'^[^\*]*[ \t]*.subckt[ \t]+([^ \t]+).*$', re.IGNORECASE
r'^[^\*]*[ \t]*.subckt[ \t]+([^ \t]+).*$', re.IGNORECASE
)
with open(spicepath, 'r') as ifile:
duttext = ifile.read()
Expand Down Expand Up @@ -219,10 +219,10 @@ def check_schematic_out_of_date(spicepath, schempath, debug=False):
# and check those dates, too.
schemdir = os.path.split(schempath)[0]
schrex = re.compile(
'\*\*[ \t]*sch_path:[ \t]*([^ \t\n]+)', re.IGNORECASE
r'\*\*[ \t]*sch_path:[ \t]*([^ \t\n]+)', re.IGNORECASE
)
subrex = re.compile(
'^[^\*]*[ \t]*.subckt[ \t]+([^ \t]+).*$', re.IGNORECASE
r'^[^\*]*[ \t]*.subckt[ \t]+([^ \t]+).*$', re.IGNORECASE
)
with open(spicepath, 'r') as ifile:
duttext = ifile.read()
Expand Down Expand Up @@ -690,7 +690,7 @@ def regenerate_schematic_netlist(datasheet, runtime_options):

else:
# Do a quick parse of the netlist to check for errors
missrex = re.compile('[ \t]*([^ \t]+)[ \t]+IS MISSING')
missrex = re.compile(r'[ \t]*([^ \t]+)[ \t]+IS MISSING')
with open(schem_netlist, 'r') as ifile:
schemlines = ifile.read().splitlines()
for line in schemlines:
Expand Down Expand Up @@ -807,7 +807,7 @@ def regenerate_testbench(datasheet, runtime_options, testbenchpath, testbench):
printwarn(xout)

# Do a quick parse of the netlist to check for errors
missrex = re.compile('[ \t]*([^ \t]+)[ \t]+IS MISSING')
missrex = re.compile(r'[ \t]*([^ \t]+)[ \t]+IS MISSING')
with open(netlist_file, 'r') as ifile:
schemlines = ifile.read().splitlines()
for line in schemlines:
Expand Down
2 changes: 1 addition & 1 deletion cace/parameter/parameter_netgen_lvs.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def implementation(self):

is_subckt = False
subrex = re.compile(
'^[^\*]*[ \t]*.subckt[ \t]+([^ \t]+).*$', re.IGNORECASE
r'^[^\*]*[ \t]*.subckt[ \t]+([^ \t]+).*$', re.IGNORECASE
)
with open(layout_netlist) as ifile:
spitext = ifile.read()
Expand Down

0 comments on commit b5b9b31

Please sign in to comment.