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

Fix float16 support [#2379] #2483

Merged
merged 2 commits into from
Feb 10, 2022
Merged

Fix float16 support [#2379] #2483

merged 2 commits into from
Feb 10, 2022

Conversation

blrnw3
Copy link
Contributor

@blrnw3 blrnw3 commented Feb 9, 2022

Convert to float32 on startup unless backed, in which case error.
scipy does not support complex slicing from float16 data so this is the easiest fix for now.

Reviewers

Functional:

Readability:


Changes

  • add
  • remove
  • modify

Convert to float32 on startup unless backed, in which case error. scipy does not support complex slicing from float16 data so this is the easiest fix for now.
@codecov
Copy link

codecov bot commented Feb 9, 2022

Codecov Report

Merging #2483 (54d5b37) into main (ceb0cc6) will increase coverage by 0.02%.
The diff coverage is 100.00%.

❗ Current head 54d5b37 differs from pull request most recent head a7a4f69. Consider uploading reports for the commit a7a4f69 to get more accurate results

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2483      +/-   ##
==========================================
+ Coverage   71.59%   71.61%   +0.02%     
==========================================
  Files          94       94              
  Lines        6449     6454       +5     
  Branches      739      739              
==========================================
+ Hits         4617     4622       +5     
  Misses       1756     1756              
  Partials       76       76              
Flag Coverage Δ
frontend 71.61% <100.00%> (+0.02%) ⬆️
javascript 71.61% <100.00%> (+0.02%) ⬆️
smokeTestAnnotations ?
unitTest 71.61% <100.00%> (+0.02%) ⬆️

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

Impacted Files Coverage Δ
server/data_anndata/anndata_adaptor.py 84.68% <100.00%> (+0.37%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ceb0cc6...a7a4f69. Read the comment docs.

@blrnw3 blrnw3 marked this pull request as ready for review February 9, 2022 01:36
raise DatasetAccessError(f"Data matrix in {self.data.X.dtype} format is not supported in backed mode."
" Please reload without --backed, or convert matrix to float32")
warnings.warn(
f"Anndata data matrix is in unsupported {self.data.X.dtype} format so will be recast to float32"
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: suggest grammatical improvement to message eg,

Anndata data matrix is in unsupported {self.data.X.dtype} format -- will be cast to float32.

Copy link
Contributor

@bkmartinjr bkmartinjr left a comment

Choose a reason for hiding this comment

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

LGTM. One optional minor comment on an message.

@blrnw3 blrnw3 merged commit 8bac98f into main Feb 10, 2022
@blrnw3 blrnw3 deleted the brodgers/float16 branch February 10, 2022 23:20
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.

2 participants