question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ValueError: Your adata doesn't have the key for Vector Field with None basis.

See original GitHub issue

Hi @Xiaojieqiu When running your zebrafish example, I encountered the following error when running dyn.pl.plot_energy(adata).


ValueError Traceback (most recent call last) ----> 1 dyn.pl.plot_energy(adata)

python3.8/site-packages/dynamo/plot/scVectorField.py in plot_energy(adata, basis, vecfld_dict, figsize, fig, save_show_or_return, save_kwargs) 1198 vf_key = "VecFld" if basis is None else "VecFld_" + basis 1199 if vf_key not in adata.uns.keys(): -> 1200 raise ValueError( f"Your adata doesn't have the key for Vector Field with {basis} basis." 1202 f"Try firstly running dyn.tl.VectorField(adata, basis={basis})."

ValueError: Your adata doesn't have the key for Vector Field with None basis. Try firstly running dyn.tl.VectorField(adata, basis=None).

Moreover, when changing the code to dyn.pl.plot_energy(adata, basis="umap"), I received the following error which seems due to the missing VecFld+basis key in our data.


KeyError Traceback (most recent call last)

----> 1 dyn.pl.plot_energy(adata, basis="umap")

python3.8/site-packages/dynamo/plot/scVectorField.py in plot_energy(adata, basis, vecfld_dict, figsize, fig, save_show_or_return, save_kwargs) 1205 vecfld_dict = adata.uns[vf_key] 1206 -> 1207 E = vecfld_dict["VecFld"]["E_traj"] if "E_traj" in vecfld_dict["VecFld"] else None 1208 tecr = vecfld_dict["VecFld"]["tecr_traj"] if "tecr_traj" in vecfld_dict["VecFld"] else None 1209

KeyError: 'VecFld'

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
Xiaojieqiucommented, Oct 12, 2021

M is for the number control point and cannot be larger than the total cell number. Moreover, in general, it should only be a few hundred (like 100) because we only need a small number of control points to approximate the vector field which also gives tremendous computational speedup.

Please try python setup install the latest version of dynamo, pulled from this github repo. And then rerun the code I shared above. We will try to release a new version (1.0.1) on PyPi soon

0reactions
behroozazarkhalilicommented, Oct 12, 2021

M is for the number control point and cannot be larger than the total cell number. Moreover, in general, it should only be a few hundred (like 100) because we only need a small number of control points to approximate the vector field which also gives tremendous computational speedup.

Please try python setup install the latest version of dynamo, pulled from this github repo. And then rerun the code I shared above. We will try to release a new version (1.0.1) on PyPi soon

I will do so. I appreciate your clarification.

Read more comments on GitHub >

github_iconTop Results From Across the Web

dynamo.plot.scVectorField — dynamo 0.95.1 documentation
Returns ------- Nothing, but plot the vector field with quiver, streamline and ... f"The {basis} dimension reduction is not performed over your data...
Read more >
ValueError: Field doesn't exists [Odoo 12] - Stack Overflow
I'm trying to get a client_order_ref from a sale order, from the account.invoice module. I don't know why it says that the field...
Read more >
How to use HDF5 files in Python
Basic Saving and Reading Data. The best way to get started is to dive into the use of the HDF5 library. Let's create...
Read more >
h2o.model.model_base — H2O documentation
[docs] def get_xval_models(self, key=None): """ Return a Model object. ... return vals else: print("Warning: This model doesn't have variable importances").
Read more >
Working with missing data — pandas 1.5.2 documentation
So as compared to above, a scalar equality comparison versus a None/np.nan doesn't provide useful information. >>> In [13]: df2 ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found