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

I found a bug #31

Open
Andymare1994 opened this issue Apr 20, 2024 · 1 comment
Open

I found a bug #31

Andymare1994 opened this issue Apr 20, 2024 · 1 comment

Comments

@Andymare1994
Copy link


ValueError Traceback (most recent call last)
Cell In[10], line 28
25 adata.layers["fit_t"] = latent_time.values * scaling[np.newaxis, :]
26 adata.var['fit_scaling'] = 1.0
---> 28 add_velovi_outputs_to_adata(adata, vae)

Cell In[10], line 25, in add_velovi_outputs_to_adata(adata, vae)
18 adata.var["fit_gamma"] = vae.get_rates()["gamma"] / scaling
19 adata.var["fit_t_"] = (
20 torch.nn.functional.softplus(vae.module.switch_time_unconstr)
21 .detach()
22 .cpu()
23 .numpy()
24 ) * scaling
---> 25 adata.layers["fit_t"] = latent_time.values * scaling[np.newaxis, :]
26 adata.var['fit_scaling'] = 1.0

File ~/miniconda3/envs/velovi/lib/python3.9/site-packages/pandas/core/series.py:1153, in Series.getitem(self, key)
1150 key = np.asarray(key, dtype=bool)
1151 return self._get_rows_with_mask(key)
-> 1153 return self._get_with(key)

File ~/miniconda3/envs/velovi/lib/python3.9/site-packages/pandas/core/series.py:1163, in Series._get_with(self, key)
1158 raise TypeError(
1159 "Indexing a Series with DataFrame is not "
1160 "supported, use the appropriate DataFrame column"
1161 )
1162 elif isinstance(key, tuple):
-> 1163 return self._get_values_tuple(key)
1165 elif not is_list_like(key):
1166 # e.g. scalars that aren't recognized by lib.is_scalar, GH#32684
1167 return self.loc[key]

File ~/miniconda3/envs/velovi/lib/python3.9/site-packages/pandas/core/series.py:1203, in Series._get_values_tuple(self, key)
1198 if com.any_none(*key):
1199 # mpl compat if we look up e.g. ser[:, np.newaxis];
1200 # see tests.series.timeseries.test_mpl_compat_hack
1201 # the asarray is needed to avoid returning a 2D DatetimeArray
1202 result = np.asarray(self._values[key])
-> 1203 disallow_ndim_indexing(result)
1204 return result
1206 if not isinstance(self.index, MultiIndex):

File ~/miniconda3/envs/velovi/lib/python3.9/site-packages/pandas/core/indexers/utils.py:341, in disallow_ndim_indexing(result)
333 """
334 Helper function to disallow multi-dimensional indexing on 1D Series/Index.
335
(...)
338 in GH#30588.
339 """
340 if np.ndim(result) > 1:
--> 341 raise ValueError(
342 "Multi-dimensional indexing (e.g. obj[:, None]) is no longer "
343 "supported. Convert to a numpy array before indexing instead."
344 )

ValueError: Multi-dimensional indexing (e.g. obj[:, None]) is no longer supported. Convert to a numpy array before indexing instead.

@Andymare1994
Copy link
Author

add_velovi_outputs_to_adata(adata, vae)

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

No branches or pull requests

1 participant