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

STY: Miscellaneous cleanups #645

Merged
merged 7 commits into from
May 3, 2023
Merged

STY: Miscellaneous cleanups #645

merged 7 commits into from
May 3, 2023

Conversation

effigies
Copy link
Contributor

@effigies effigies commented May 3, 2023

Types of changes

  • Style, slight refactor

Summary

While looking into type checking failures, some style issues caught my eye. Rather than bundle them in, I am putting them in a standalone PR. This PR has three commits, each of which can be considered separately, if you disagree.

  • Replace __file__ calls with importlib.resources where appropriate. I wrapped it in a pytest fixture to save repetition. This is considered good hygiene, as __file__ may not be available when packages are zipped.
  • Drop f"...{str(x)}..." idiom. This is a straightforward win for readability.
  • Just ran pyupgrade --py38-plus, followed by black for cleanup. This auto-upgrades from idioms that are no longer needed to ones that are universally supported in 3.8+.

Closes #282.

Checklist

  • I have added tests to cover my changes (if necessary)
  • I have updated documentation (if necessary)

@codecov
Copy link

codecov bot commented May 3, 2023

Codecov Report

Patch coverage: 80.00% and project coverage change: -0.64 ⚠️

Comparison is base (64bfa89) 81.77% compared to head (c1a8983) 81.13%.

❗ Current head c1a8983 differs from pull request most recent head 4da0a35. Consider uploading reports for the commit 4da0a35 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #645      +/-   ##
==========================================
- Coverage   81.77%   81.13%   -0.64%     
==========================================
  Files          20       20              
  Lines        4394     4400       +6     
  Branches     1264        0    -1264     
==========================================
- Hits         3593     3570      -23     
- Misses        797      830      +33     
+ Partials        4        0       -4     
Flag Coverage Δ
unittests 81.13% <80.00%> (-0.64%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
pydra/engine/helpers_file.py 86.10% <ø> (ø)
pydra/engine/workers.py 18.76% <33.33%> (ø)
pydra/engine/audit.py 94.04% <66.66%> (-3.46%) ⬇️
pydra/__init__.py 90.90% <100.00%> (+0.43%) ⬆️
pydra/engine/core.py 92.96% <100.00%> (-0.16%) ⬇️
pydra/engine/helpers_state.py 95.61% <100.00%> (ø)
pydra/engine/state.py 96.39% <100.00%> (ø)
pydra/mark/__init__.py 100.00% <100.00%> (ø)
pydra/utils/messenger.py 95.89% <100.00%> (ø)

... and 4 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@effigies effigies force-pushed the mnt/refurb branch 2 times, most recently from a6f41ba to 9d442d4 Compare May 3, 2023 01:40
@djarecka
Copy link
Collaborator

djarecka commented May 3, 2023

lgtm! thank you!

@effigies
Copy link
Contributor Author

effigies commented May 3, 2023

Are these random 3.11 failures expected?

@djarecka
Copy link
Collaborator

djarecka commented May 3, 2023

no, i didn't notice it... and it's not even test failure, but some INTERNALERROR...

@effigies
Copy link
Contributor Author

effigies commented May 3, 2023

It happened on 99df677 as well, so at least I'm not introducing it with something I've done here. My guess is it's an out-of-memory error causing an xdist worker to get killed.

@effigies effigies merged commit 426564e into nipype:master May 3, 2023
@effigies effigies deleted the mnt/refurb branch May 3, 2023 20:43
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.

Replace __file__ with pkg_resources to make the package zip-safe
2 participants