harrispopgen / mushi

[mu]tation [s]pectrum [h]istory [i]nference
https://harrispopgen.github.io/mushi/
MIT License
24 stars 6 forks source link

test.ipynb broken #29

Closed kamdh closed 5 years ago

kamdh commented 5 years ago

There is no longer any mushi.η function. What is our current test case notebook? Trying to test my fixes to acceleration before committing.

kamdh commented 5 years ago
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-4-3fe0effdccc7> in <module>
      5                                 migration_matrix=model.migration_matrix)
      6 y = 2 * dd.population_size_trajectory(np.concatenate(([0], t)))[:, 1]
----> 7 η = mushi.η(t, y)
      8 
      9 plt.figure(figsize=(3, 3))

AttributeError: module 'mushi' has no attribute 'η'
kamdh commented 5 years ago

Fixed now

kamdh commented 5 years ago
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-10-d19d7d277a51> in <module>
      3 ksfs_Tennessen.simulate(μ, seed=1)
      4 
----> 5 ksfs_Browning = mushi.kSFS(η_Browning, X=ksfs_Tennessen.X)
      6 
      7 sfs_Tennessen.clustermap(figsize=(10, 5))

~/work/mushi/mushi.py in __init__(self, η, X, n, mutation_types)
     33             self.n = len(X) + 1
     34             self.mutation_types = pd.Index(mutation_types,
---> 35                                            name='mutation type')
     36         elif not n:
     37             raise ValueError('either x or n must be specified')

~/local/anaconda2/envs/py36/lib/python3.6/site-packages/pandas/core/indexes/base.py in __new__(cls, data, dtype, copy, name, fastpath, tupleize_cols, **kwargs)
    466                          **kwargs)
    467         elif data is None or is_scalar(data):
--> 468             cls._scalar_data_error(data)
    469         else:
    470             if tupleize_cols and is_list_like(data):

~/local/anaconda2/envs/py36/lib/python3.6/site-packages/pandas/core/indexes/base.py in _scalar_data_error(cls, data)
   3797         raise TypeError('{0}(...) must be called with a collection of some '
   3798                         'kind, {1} was passed'.format(cls.__name__,
-> 3799                                                       repr(data)))
   3800 
   3801     @classmethod

TypeError: Index(...) must be called with a collection of some kind, None was passed
wsdewitt commented 5 years ago

@kharris 30e14e74 should fix!

kamdh commented 5 years ago

Almost! Made it to cell 18

---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-18-8e5427d21309> in <module>
      2 for ct, i in enumerate((0, 10), 1):
      3     plt.subplot(1, 3, ct)
----> 4     sfs.plot(i, μ=μ_inferred, prf_quantiles=True)
      5 plt.tight_layout()
      6 plt.show()

NameError: name 'sfs' is not defined