scipy.spatial.sKDTree does not have a keyword argument 'n_jobs'
- [x] I have checked that this issue has not already been reported.
- [x] I have confirmed this bug exists on the latest version of scanpy.
- [ ] (optional) I have confirmed this bug exists on the master branch of scanpy.
Note: Please read this guide detailing how to provide the necessary information for us to reproduce your bug.
Minimal code sample (that we can copy&paste without having any data)
sce.pp.mnn_correct(adata_ref_batch0, adata_ref_batch1, adata_ref_batch2, batch_categories = ['batch0', 'batch1', 'batch2'])

---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
/tmp/ipykernel_1797574/3779544909.py in <module>
----> 1 sce.pp.mnn_correct(adata_ref_batch0, adata_ref_batch1, adata_ref_batch2, batch_categories = ['batch0', 'batch1', 'batch2'])
/mnt/md0/jin/anaconda3/lib/python3.9/site-packages/scanpy/external/pp/_mnn_correct.py in mnn_correct(var_index, var_subset, batch_key, index_unique, batch_categories, k, sigma, cos_norm_in, cos_norm_out, svd_dim, var_adj, compute_angle, mnn_order, svd_mode, do_concatenate, save_raw, n_jobs, *datas, **kwargs)
133
134 n_jobs = settings.n_jobs if n_jobs is None else n_jobs
--> 135 datas, mnn_list, angle_list = mnn_correct(
136 *datas,
137 var_index=var_index,
/mnt/md0/jin/anaconda3/lib/python3.9/site-packages/mnnpy/mnn.py in mnn_correct(var_index, var_subset, batch_key, index_unique, batch_categories, k, sigma, cos_norm_in, cos_norm_out, svd_dim, var_adj, compute_angle, mnn_order, svd_mode, do_concatenate, save_raw, n_jobs, *datas, **kwargs)
120 if var_subset is not None and set(adata_vars) == set(var_subset):
121 var_subset = None
--> 122 corrected = mnn_correct(*(adata.X for adata in datas), var_index=adata_vars,
123 var_subset=var_subset, k=k, sigma=sigma, cos_norm_in=cos_norm_in,
124 cos_norm_out=cos_norm_out, svd_dim=svd_dim, var_adj=var_adj,
/mnt/md0/jin/anaconda3/lib/python3.9/site-packages/mnnpy/mnn.py in mnn_correct(var_index, var_subset, batch_key, index_unique, batch_categories, k, sigma, cos_norm_in, cos_norm_out, svd_dim, var_adj, compute_angle, mnn_order, svd_mode, do_concatenate, save_raw, n_jobs, *datas, **kwargs)
176 new_batch_out = out_batches[target]
177 print(' Looking for MNNs...')
--> 178 mnn_ref, mnn_new = find_mutual_nn(data1=ref_batch_in, data2=new_batch_in, k1=k, k2=k,
179 n_jobs=n_jobs)
180 print(' Computing correction vectors...')
_ckdtree.pyx in scipy.spatial._ckdtree.cKDTree.query()
_ckdtree.pyx in scipy.spatial._ckdtree.get_num_workers()
TypeError: Unexpected keyword argument {'n_jobs': 48}
---------------------------------------------------------------------------
Versions
python 3.9
[Paste the output of scanpy.logging.print_versions() leaving a blank line after the details tag]
Would you be willing to file a PR for this? Thank you!
Hi Lukas,
I am sorry, but what is a PR?
Best Jin
ᐧ
On Fri, Mar 10, 2023 at 5:02 AM Lukas Heumos @.***> wrote:
Would you be willing to file a PR for this? Thank you!
— Reply to this email directly, view it on GitHub https://github.com/scverse/scanpy/issues/2436#issuecomment-1463561536, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFOKIW345IGREVLPLR7F6BLW3L32JANCNFSM6AAAAAAVQOJ5FE . You are receiving this because you authored the thread.Message ID: @.***>
A pull request that fixes this :)
See https://scanpy.readthedocs.io/en/stable/dev/index.html
I have been trying but I am not sure how to do it in an appropriate way.
Can you teach me how to do it? I am not super familiar with git stuff since I am not really using it. ᐧ
On Mon, Mar 13, 2023 at 5:10 AM Lukas Heumos @.***> wrote:
A pull request that fixes this :)
See https://scanpy.readthedocs.io/en/stable/dev/index.html
— Reply to this email directly, view it on GitHub https://github.com/scverse/scanpy/issues/2436#issuecomment-1465764371, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFOKIW6MR6MSUCKJ2YTVG53W33P75ANCNFSM6AAAAAAVQOJ5FE . You are receiving this because you authored the thread.Message ID: @.***>