Skip to content

Replace deep relative imports with absolute imports #3766

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

Merged
merged 2 commits into from
Mar 13, 2025

Conversation

chrishalcrow
Copy link
Member

Following on from discussions in #3027 and #3764, this PR makes (most) imports absolute.

PEP8 and the default ruff and flake-8 rules allow for simple (same folder) relative imports. For now, I've been conservative with changes and left these in.

Did this with a single command:

uvx ruff check --select TID252 --fix --unsafe-fixes

Let's find out how unsafe these fixes were!

@@ -47,7 +47,7 @@

# the dataset has been downloaded locally
base_folder = Path("/mnt/data/sam/DataSpikeSorting/")
np_data_drift = base_folder / 'human_neuropixel" / "Pt02"
np_data_drift = base_folder / "human_neuropixel" / "Pt02"
Copy link
Member Author

Choose a reason for hiding this comment

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

ruff also kept brining up this typo that I couldn't help but correct.... Everything else are automated fixes from ruff.

@alejoe91 alejoe91 added the packaging Related to packaging/style label Mar 13, 2025
@alejoe91 alejoe91 merged commit 58c70af into SpikeInterface:main Mar 13, 2025
24 of 29 checks passed
@chrishalcrow
Copy link
Member Author

Fastest merge I've ever seen

@chrishalcrow chrishalcrow deleted the absolute-imports branch March 13, 2025 10:25
This was referenced Mar 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
packaging Related to packaging/style
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants