Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecation warning: Invalid Escape Sequence #26

Open
lupeterm opened this issue Apr 28, 2023 · 2 comments
Open

Deprecation warning: Invalid Escape Sequence #26

lupeterm opened this issue Apr 28, 2023 · 2 comments
Assignees

Comments

@lupeterm
Copy link
Collaborator

lupeterm commented Apr 28, 2023

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 lupeterm self-assigned this Apr 28, 2023
@greole
Copy link
Owner

greole commented Apr 28, 2023

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

@lupeterm
Copy link
Collaborator Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants