-
Notifications
You must be signed in to change notification settings - Fork 155
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 is_categorical_dtype warning #1099
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #1099 +/- ##
==========================================
- Coverage 84.79% 82.67% -2.12%
==========================================
Files 35 35
Lines 5090 5098 +8
==========================================
- Hits 4316 4215 -101
- Misses 774 883 +109
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Co-authored-by: Isaac Virshup <[email protected]>
for more information, see https://pre-commit.ci
@ivirshup all done |
About the extra change
It looks like this will only be the case for small data, since afaict the error message from the assertion is just dumping the repr of each object into the exception message: In [30]: adata.obsm["b"] = b.to_df()
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
Cell In[30], line 1
----> 1 adata.obsm["b"] = b.to_df()
File ~/github/anndata/anndata/_core/aligned_mapping.py:189, in AlignedActualMixin.__setitem__(self, key, value)
188 def __setitem__(self, key: str, value: V):
--> 189 value = self._validate_value(value, key)
190 self._data[key] = value
File ~/github/anndata/anndata/_core/aligned_mapping.py:254, in AxisArraysBase._validate_value(self, val, key)
252 except AssertionError as e:
253 msg = f"value.index does not match parent’s axis {self.axes[0]} names:\n{e}"
--> 254 raise ValueError(msg) from None
255 else:
256 msg = "Index.equals and pd.testing.assert_index_equal disagree"
ValueError: value.index does not match parent’s axis 0 names:
Index are different
Index values are different (0.03791 %)
[left]: Index(['AAACATACAACCAC-1', 'AAACATTGAGCTAC-1', 'AAACATTGATCAGC-1',
'AAACCGTGCTTCCG-1', 'AAACCGTGTATGCG-1', 'AAACGCACTGGTAC-1',
'AAACGCTGACCAGT-1', 'AAACGCTGGTTCTT-1', 'AAACGCTGTAGCCA-1',
'AAACGCTGTTTCTG-1',
...
'TTTCAGTGTCACGA-1', 'TTTCAGTGTCTATC-1', 'TTTCAGTGTGCAGT-1',
'TTTCCAGAGGTGAG-1', 'TTTCGAACACCTGA-1', 'TTTCGAACTCTCAT-1',
'TTTCTACTGAGGCA-1', 'TTTCTACTTCCTCG-1', 'TTTGCATGAGAGGC-1',
'TTTGCATGCCTCAC-1'],
dtype='object', length=2638)
[right]: Index(['AAACATACAACCAC-1', 'AAACATTGAGCTAC-1', 'AAACATTGATCAGC-1',
'AAACCGTGCTTCCG-1', 'AAACCGTGTATGCG-1', 'AAACGCACTGGTAC-1',
'AAACGCTGACCAGT-1', 'AAACGCTGGTTCTT-1', 'AAACGCTGTAGCCA-1',
'AAACGCTGTTTCTG-1',
...
'TTTCAGTGTCACGA-1', 'TTTCAGTGTCTATC-1', 'TTTCAGTGTGCAGT-1',
'TTTCCAGAGGTGAG-1', 'TTTCGAACACCTGA-1', 'TTTCGAACTCTCAT-1',
'TTTCTACTGAGGCA-1', 'TTTCTACTTCCTCG-1', 'TTTGCATGAGAGGC-1',
'TTTGCATGCCTCAC-1'],
dtype='object', name='index', length=2638) ^ In this case the mismatched values are in the middle, and it's a relatively small dataset. I'm fine to keep this for now, but also fine to remove it later without needing to keep the same level of detail. |
Oh, also should this be backported? It's tagged as 0.10, but seems like it could be fine for 0.9.3 (not that I suspect we'll be making that release) |
But do feel free to merge. The points above are for your consideration, but are not blocking |
OK, doesn’t seem like this would merge anywhere near cleanly. Let’s not risk it. |
No description provided.