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

ENH: set and expose global dicom compresslevel var #669

Merged
merged 2 commits into from Apr 29, 2023

Conversation

octomike
Copy link
Contributor

Python's tarfile is using a compression level of 9 by default (back to and including python 3.5): https://docs.python.org/3/library/tarfile.html#tarfile.open

We see cases where this leads to a large waste of cpu cycles with minimal gain as opposed to compress level 5 or even 1.

Setting a global compresslevel variable makes it easy to override from our heuristics, keeping the default with minimal code impact.

@codecov
Copy link

codecov bot commented Apr 22, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (502bf49) 81.48% compared to head (67d4703) 81.48%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #669   +/-   ##
=======================================
  Coverage   81.48%   81.48%           
=======================================
  Files          41       41           
  Lines        3899     3900    +1     
=======================================
+ Hits         3177     3178    +1     
  Misses        722      722           
Impacted Files Coverage Δ
heudiconv/dicoms.py 86.15% <100.00%> (+0.05%) ⬆️

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

Co-authored-by: Yaroslav Halchenko <debian@onerussian.com>
@@ -20,6 +20,9 @@

lgr = logging.getLogger(__name__)
total_files = 0
# Might be monkey patched by user heuristic to tune desired compression level
# Preferably do not move/rename unless
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
# Preferably do not move/rename unless
# Preferably do not move/rename unless

Copy link
Member

Choose a reason for hiding this comment

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

hey github -- where is mergecommit button???

@yarikoptic yarikoptic merged commit 67d4703 into nipy:master Apr 29, 2023
8 of 9 checks passed
@github-actions
Copy link

github-actions bot commented May 8, 2023

🚀 PR was released in v0.13.0 🚀

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

Successfully merging this pull request may close these issues.

None yet

2 participants