-
Notifications
You must be signed in to change notification settings - Fork 157
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 uns merge 3d #1302
Fix uns merge 3d #1302
Changes from all commits
7ad9554
5a8f424
d809348
11fa999
4058e44
18aa674
6e6c55f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,7 @@ | |
as_dense_dask_array, | ||
assert_equal, | ||
gen_adata, | ||
gen_vstr_recarray, | ||
) | ||
from anndata.utils import asarray | ||
|
||
|
@@ -1018,6 +1019,15 @@ def gen_something(n): | |
return np.random.choice(options)(n) | ||
|
||
|
||
def gen_3d_numeric_array(n): | ||
return np.random.randn(n, n, n) | ||
|
||
|
||
def gen_3d_recarray(_): | ||
# Ignoring n as it can get quite slow | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What does this mean exactly? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Which part?
n is a parameter passed to all the other functions here. Generally it changes the size of the result, but we ignore that in a couple cases. Here I ignore it because it made some test cases take over a minute. |
||
return gen_vstr_recarray(8, 3).reshape(2, 2, 2) | ||
|
||
|
||
def gen_concat_params(unss, compat2result): | ||
value_generators = [ | ||
lambda x: x, | ||
|
@@ -1026,6 +1036,8 @@ def gen_concat_params(unss, compat2result): | |
gen_list, | ||
gen_sparse, | ||
gen_something, | ||
gen_3d_numeric_array, | ||
gen_3d_recarray, | ||
] | ||
for gen, (mode, result) in product(value_generators, compat2result.items()): | ||
yield pytest.param(unss, mode, result, gen) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does
_.reshape(-1)
mean? The numpy docs saySo what you do basically creates 1D
pd.DataFrames
? Shouldn’t we make and comparepd.Series
then?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would make sense, but in practice the Series constructor acts differently and throws errors for some of the non-numeric dtypes.