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

Add float_datatype parameter for SingleCells compartment load and merge performance flexibility #248

Merged
merged 7 commits into from
Dec 22, 2022

Conversation

d33bs
Copy link
Member

@d33bs d33bs commented Dec 16, 2022

Description

This change adds a float_datatype parameter for use with SingleCells compartment load and merge operations to assist with performance considerations (as cited within WayScience/cell-health-data#10 and other areas). In testing this locally using np.float32 instead of np.float64 I found ~45% reduction in peak memory consumption while running merge_single_cells on small testing datasets (this reduction may vary contingent on dataset).

This change is also related to #198 and #227 (if only to notate datatype considerations).

What is the nature of your change?

  • Bug fix (fixes an issue).
  • Enhancement (adds functionality).
  • Breaking change (fix or feature that would cause existing functionality to not work as expected).
  • This change requires a documentation update.

Checklist

Please ensure that all boxes are checked before indicating that a pull request is ready for review.

  • I have read the CONTRIBUTING.md guidelines.
  • My code follows the style guidelines of this project.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.
  • New and existing unit tests pass locally with my changes.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have deleted all non-relevant text in this pull request template.

@codecov-commenter
Copy link

codecov-commenter commented Dec 16, 2022

Codecov Report

Merging #248 (6801c29) into master (b789165) will decrease coverage by 0.02%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #248      +/-   ##
==========================================
- Coverage   95.74%   95.71%   -0.03%     
==========================================
  Files          53       53              
  Lines        2822     2826       +4     
==========================================
+ Hits         2702     2705       +3     
- Misses        120      121       +1     
Flag Coverage Δ
unittests 95.71% <100.00%> (-0.03%) ⬇️

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

Impacted Files Coverage Δ
pycytominer/cyto_utils/cells.py 96.81% <100.00%> (-0.39%) ⬇️
pycytominer/tests/test_cyto_utils/test_cells.py 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Member

@gwaybio gwaybio left a comment

Choose a reason for hiding this comment

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

Looks good @d33bs ! This should help @axiomcura in WayScience/cell-health-data#10 (I think this was the right PR to tag here, but it will also likely help many others as well!)

pycytominer/cyto_utils/cells.py Outdated Show resolved Hide resolved
pycytominer/cyto_utils/cells.py Outdated Show resolved Hide resolved
pycytominer/tests/test_cyto_utils/test_cells.py Outdated Show resolved Hide resolved
pycytominer/tests/test_cyto_utils/test_cells.py Outdated Show resolved Hide resolved
pycytominer/tests/test_cyto_utils/test_cells.py Outdated Show resolved Hide resolved
Copy link
Member

@gwaybio gwaybio left a comment

Choose a reason for hiding this comment

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

Looks good @d33bs ! Only two minor comments but then I think we're good to merge.

pycytominer/tests/test_cyto_utils/test_cells.py Outdated Show resolved Hide resolved
pycytominer/tests/test_cyto_utils/test_cells.py Outdated Show resolved Hide resolved
@gwaybio
Copy link
Member

gwaybio commented Dec 22, 2022

Looks good! I'm going to merge. Thanks @d33bs

@gwaybio gwaybio merged commit afac3ea into cytomining:master Dec 22, 2022
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.

3 participants