owls icon indicating copy to clipboard operation
owls copied to clipboard

Deprecation warning: Invalid Escape Sequence

Open lupeterm opened this issue 2 years ago • 2 comments

For example, in test_findermethods.py:92, regular expressions use invalid escaping:

eulerian_decomp = io.find_datafolders(
    regex="processor[0-9]\/" + io.FPNUMBER, path=fold, slice_="all"
)                        ^  DeprecationWarning: invalid escape sequence \/

Also, please note that any invalid escape sequences in Python’s usage of the backslash in string literals now generate a DeprecationWarning and in the future this will become a SyntaxError. (Source)

Should be easily fixed by declaring regular expressions as raw strings, e.g.,

eulerian_decomp = io.find_datafolders(
    regex=r"processor[0-9]\/" + io.FPNUMBER, path=fold, slice_="all"
) 

edit: corrected misinformation on my part

lupeterm avatar Apr 28 '23 07:04 lupeterm

If you prepare a PR to fix the issues with missing Origin and other type info you could a fix for this issue!

greole avatar Apr 28 '23 11:04 greole

If you are referring to the previously removed Origin class, I already worked on that in commit 4f67d1fea01fd57fa63e35c470ba4ba987dce470 of the pipeline-fixes branch. As per the type annotations, I would probably create a separate branch for that.

lupeterm avatar Apr 29 '23 08:04 lupeterm