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.

Fst gives a NoneType error when no indices are given (the default)

See original GitHub issue

I have a simulation that does the right thing when I explicitly specify pairs of indices:

ts.Fst(sample_sets = samples_list,
      indexes = [(0,2), (0,1)])

outputs

array([[0.12508121, 0.12780193]])

but that gives the following error if I remove the indexes input (and so use the default value of None)

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-6-fbfb01290311> in <module>
----> 1 ts.Fst(sample_sets = samples_list)

/usr/local/lib/python3.7/site-packages/tskit/trees.py in Fst(self, sample_sets, indexes, windows, mode, span_normalise)
   3332         fst = np.repeat(1.0, np.product(divergences.shape))
   3333         fst.shape = divergences.shape
-> 3334         for i, (u, v) in enumerate(indexes):
   3335             denom = (diversities[:, :, u] + diversities[:, :, v]
   3336                      + 2 * divergences[:, :, i])

TypeError: 'NoneType' object is not iterable

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
petrelharpcommented, Aug 20, 2019

Whoops; missed this. Let’s discuss at #315 .

0reactions
jeromekellehercommented, Aug 20, 2019

I’ve had a change of heart here, and think maybe we should hold off on specifying a default for this—see the comment in #313

Read more comments on GitHub >

github_iconTop Results From Across the Web

Implement pairwise Fst · Issue #199 · tskit-dev/tskit - GitHub
Having thought some more about the two alternative Fst ... Fst gives a NoneType error when no indices are given (the default) #250....
Read more >
az servicebus list gives NoneType error in python
Command Name I tried az servicebus namespace list but after some outputs it gives me NoneType error means no data is retrieved.
Read more >
OpenCV: Resolving NoneType errors - PyImageSearch
When using OpenCV and Python together you'll inevitably run into NoneType errors. Here's how to resolve them.
Read more >
Automatic IDs, None Defaults, and Refreshing Data - SQLModel
Now let's talk a bit about why the id field can't be NULL on the database because it's a primary key, and we...
Read more >
Lesson 2 : Error while executing batches, preds ... - Fast.ai forums
I was able to run vgg.test without any hassl… ... So I gave my testpath as below ... I get 0 images found...
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