Skip to content

Miscellaneous minor cleanups#747

Merged
takluyver merged 1 commit into
masterfrom
chore/misc-cleanup
Jun 10, 2026
Merged

Miscellaneous minor cleanups#747
takluyver merged 1 commit into
masterfrom
chore/misc-cleanup

Conversation

@takluyver

Copy link
Copy Markdown
Member

Modernising type hints, removing unused imports and unnecessary character escapes. This cuts down on the warnings I see in Pycharm.

I'll merge this so long as the tests pass, I don't think it's worth review.

@takluyver takluyver added this to the 1.25 milestone Jun 10, 2026
@takluyver takluyver merged commit 171a1bb into master Jun 10, 2026
10 checks passed
Comment thread extra_data/file_access.py
# Paths starting with /gpfs/exfel/exp are either the canonical link
# on Maxwell or an ONC path.
euxfel_exp_path_pattern = re.compile(
r'\/gpfs\/exfel\/exp\/(\w+)\/(\d{6})\/p(\d{6})\/([a-z]+)\/(?:r(\d{4})|.extra_data)')

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure these are not necessary? The site I am regularly using to test regexps claims they are 🤷

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In Javascript and some other languages, / marks regex literals, i.e. const re = /ab+c/;. I'd guess this is what the site is referring to. But Python doesn't have regex literals, and / has no special meaning in Python style regexes. I've just double checked this interactively. re.escape("/") also doesn't add a backslash.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the clarification!

@takluyver takluyver deleted the chore/misc-cleanup branch June 11, 2026 09:31
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

Successfully merging this pull request may close these issues.

2 participants