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.

TypeError: fit() missing 3 required positional arguments: 'adata', 'x_lim', and 'y_lim'

See original GitHub issue

I encountered the following error when calling dyn.vf.Potential(adata)

import dynamo as dyn
dyn.get_all_dependencies_version()
adata = dyn.sample_data.DentateGyrus()

dyn.pp.recipe_monocle(adata)
dyn.tl.dynamics(adata)

dyn.tl.reduceDimension(adata, basis='umap', enforce=True)
dyn.tl.cell_velocities(adata, basis='umap')
dyn.tl.cell_wise_confidence(adata)

dyn.vf.VectorField(adata, basis='umap')
dyn.vf.topography(adata, basis='umap')

dyn.ext.ddhodge(adata, basis="umap")

adata.uns["VecFld"] = adata.uns.get("VecFld_umap")
dyn.vf.Potential(adata)

TypeError Traceback (most recent call last) ----> 1 dyn.vf.Potential(adata)

python3.8/site-packages/dynamo/vectorfield/scPotential.py in Potential(adata, DiffMat, method, **kwargs) 453 DiffMat = DiffusionMatrix if DiffMat is None else DiffMat 454 pot = Pot(Function, DiffMat, **kwargs) –> 455 pot.fit(method=method) 456 457 return adata

TypeError: fit() missing 3 required positional arguments: 'adata', 'x_lim', and 'y_lim'

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
Xiaojieqiucommented, Oct 10, 2021

certainly, will do! we are delayed in updating those because of other commitments recently but will start to work on updating dynamo and all related readthedocs pages largely starting from next week. Thanks!

0reactions
behroozazarkhalilicommented, Oct 10, 2021

I see the issue now, looks like you are following the 10 minutes to dynamo section (unfortunately both the Potential function and that section have not been updated because of historical reasons— can fix those next week). I would suggest you start with other tutorials, such as zebrafish, to get started with dynamo:

https://dynamo-release.readthedocs.io/en/latest/notebooks/zebrafish.html

Please also update the last cell of the tutorial as well since it also raises an error.

import matplotlib.pyplot as plt

fig1, f1_axes = plt.subplots(ncols=2, nrows=2, constrained_layout=True, figsize=(12, 10))
f1_axes
f1_axes[0, 0] = dyn.pl.cell_wise_vectors(adata, color='umap_ddhodge_potential', pointsize=0.1, alpha = 0.7, ax=f1_axes[0, 0], quiver_length=6, quiver_size=6, save_show_or_return='return')
f1_axes[0, 1] = dyn.pl.grid_vectors(adata, color='speed_umap', ax=f1_axes[0, 1], quiver_length=12, quiver_size=12, save_show_or_return='return')
f1_axes[1, 0] = dyn.pl.streamline_plot(adata, color='divergence_pca', ax=f1_axes[1, 0], save_show_or_return='return')
f1_axes[1, 1] = dyn.pl.topography(adata, color='acceleration_umap', ax=f1_axes[1, 1], save_show_or_return='return')
plt.show()
Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: fit() missing 1 required positional argument: 'y'
I am trying to predict economic cycles using Gaussian Naive Bayes "Classifier". data (input X) :
Read more >
TypeError: fit() missing 1 required positional argument: 'y'
TypeError : fit() missing 1 required positional argument: 'y'. As I was trying to fit my linear model (Logistic Regression ) to my...
Read more >
Sklearn xgb.fit: TypeError: fit() missing 1 required positional ...
First the classifier needs to be created. Then it can be fit. sklearn API works in an object oriented interface here - create...
Read more >
[Solved] TypeError when calling function - Python Forum
I'm trying to plot a multi-gaussian function to some data, ... + 3 ]). TypeError: gaussian() missing 1 required positional argument: 'width' ...
Read more >
Notebook23027410e3 - Kaggle
Explore and run machine learning code with Kaggle Notebooks | Using data from Glass ... TypeError: predict() missing 1 required positional argument: 'X'....
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