brainglobe / brainglobe-utils

Shared general purpose tools for the BrainGlobe project
MIT License
11 stars 1 forks source link

Update Pathlib usage and docstrings #68

Closed willGraham01 closed 5 months ago

willGraham01 commented 5 months ago

Description

What is this PR

Why is this PR needed?

Standardises our imports of pathlib Paths and avoids importing the whole module when we only need the Path class.

What does this PR do?

References

No issues, but picked up on in a comment on https://github.com/brainglobe/brainglobe-utils/pull/65#issuecomment-2046963476

How has this PR been tested?

Tests pass locally. No package functionality should be changed, either.

Is this a breaking change?

No.

Does this PR require an update to the documentation?

N/A

Checklist:

codecov[bot] commented 5 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 90.54%. Comparing base (3b632c2) to head (27cdba4).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #68 +/- ## ========================================== - Coverage 90.56% 90.54% -0.02% ========================================== Files 35 35 Lines 1356 1364 +8 ========================================== + Hits 1228 1235 +7 - Misses 128 129 +1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

willGraham01 commented 5 months ago

CodeCov doesn't like my TYPE_CHECKING imports in files where we don't actually need to instantiate a Path object.

Happy to change those to regular imports on reviewer's request to avoid the red-cross-of-doom :sweat_smile:

willGraham01 commented 5 months ago

For the TYPE_CHECKING imports I wonder if there's a way to exclude these lines from codecov https://github.com/nedbat/coveragepy/issues/831#issuecomment-517778185?

Went for the straight-up import solution :sweat_smile: The solution given in the linked issue seems to imply that the .coveragerc file should be on a per-repo basis, and I don't want to escalate this PR to setting a precedent for the whole project. The #pragma: no cov solution is also ugly to include in each of the blocks (and could very easily get misplaced after a few edits if imports are moved around / changed).

willGraham01 commented 5 months ago

where quotes are no longer needed around the types

VSCode linter why have you forsaken me :sob: