kwikteam / klustakwik2

Fast software for high-dimensional cluster analysis using the masked EM algorithm for Gaussians mixtures
BSD 3-Clause "New" or "Revised" License
27 stars 13 forks source link

use_mua_cluster doesn't work at all with phy #68

Closed nippoo closed 8 years ago

nippoo commented 8 years ago

phy tests are currently failing; returns the following error on tests:

=================================== FAILURES ===================================
____________________________ test_cluster_auto_prm _____________________________
chdir_tempdir = '/tmp/tmpbkvzzzt5'
    def test_cluster_auto_prm(chdir_tempdir):
        main('download hybrid_10sec.dat')
        main('download hybrid_10sec.prm')
        main('detect hybrid_10sec.prm')
>       main('cluster-auto hybrid_10sec.prm')
/home/travis/build/kwikteam/phy/tests/scripts/test_phy_spikesort.py:24: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/home/travis/build/kwikteam/phy/phy/scripts/phy_script.py:452: in main
    exec_(cmd, {}, ns)
<string>:1: in <module>
    ???
/home/travis/build/kwikteam/phy/phy/session/session.py:416: in cluster
    sc = kk.cluster(model=self.model, spike_ids=spike_ids)
/home/travis/build/kwikteam/phy/phy/cluster/algorithms/klustakwik.py:68: in cluster
    kk.cluster_mask_starts()
/home/travis/miniconda/envs/testenv/lib/python3.4/site-packages/klustakwik2/clustering.py:245: in cluster_mask_starts
    self.cluster_from(clusters)
/home/travis/miniconda/envs/testenv/lib/python3.4/site-packages/klustakwik2/clustering.py:251: in cluster_from
    return self.iterate(recurse=recurse, score_target=score_target)
/home/travis/miniconda/envs/testenv/lib/python3.4/site-packages/klustakwik2/clustering.py:372: in iterate
    did_split = self.try_splits()
/home/travis/miniconda/envs/testenv/lib/python3.4/site-packages/klustakwik2/clustering.py:64: in new_meth
    res = meth(self, *args, **kwds)
/home/travis/miniconda/envs/testenv/lib/python3.4/site-packages/klustakwik2/clustering.py:756: in try_splits
    K3 = self.copy(name='split_evaluation', map_log_to_debug=True)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
self = <klustakwik2.clustering.KK object at 0x2b20542e1208>
name = 'split_evaluation', use_noise_cluster = True, use_mua_cluster = True
additional_params = {'map_log_to_debug': True}, sep = ''
params = {'always_split_bimodal': False, 'break_fraction': 0.0, 'consider_cluster_deletion': True, 'dist_thresh': 9.2103403719761836, ...}
    def copy(self, name='kk_copy',
             use_noise_cluster=None, use_mua_cluster=None,
             **additional_params):
        if self.name:
            sep = '.'
        else:
            sep = ''
        if use_noise_cluster is None:
            use_noise_cluster = self.use_noise_cluster
        if use_mua_cluster is None:
            use_mua_cluster = self.use_mua_cluster
        params = self.params.copy()
        params.update(**additional_params)
        return KK(self.data, name=self.name+sep+name,
                  callbacks=self.callbacks,
                  use_noise_cluster=use_noise_cluster, use_mua_cluster=use_mua_cluster,
                  is_copy=True,
>                 **params)
E       TypeError: type object got multiple values for keyword argument 'use_mua_cluster'
rossant commented 8 years ago

the use_noise_cluster=use_noise_cluster, use_mua_cluster=use_mua_cluster, line should be removed maybe?

thesamovar commented 8 years ago

Yes! They're now part of **params.

On 31 July 2015 21:39:01 BST, Cyrille Rossant notifications@github.com wrote:

the use_noise_cluster=use_noise_cluster, use_mua_cluster=use_mua_cluster, should be removed maybe?


Reply to this email directly or view it on GitHub: https://github.com/kwikteam/klustakwik2/issues/68#issuecomment-126807212

thesamovar commented 8 years ago

Oh wait this is in my code. Oops! Wonder how the tests missed that. Will fix and release again tomorrow.

On 31 July 2015 21:30:43 BST, nippoo notifications@github.com wrote:

All phy tests are currently failing and 0.2.3 doesn't work with phy; returns the following error on tests:

self = <klustakwik2.clustering.KK object at 0x2b20542e1208>
name = 'split_evaluation', use_noise_cluster = True, use_mua_cluster =
True
additional_params = {'map_log_to_debug': True}, sep = ''
params = {'always_split_bimodal': False, 'break_fraction': 0.0,
'consider_cluster_deletion': True, 'dist_thresh': 9.2103403719761836,
...}
   def copy(self, name='kk_copy',
            use_noise_cluster=None, use_mua_cluster=None,
            **additional_params):
       if self.name:
           sep = '.'
       else:
           sep = ''
       if use_noise_cluster is None:
           use_noise_cluster = self.use_noise_cluster
       if use_mua_cluster is None:
           use_mua_cluster = self.use_mua_cluster
       params = self.params.copy()
       params.update(**additional_params)
       return KK(self.data, name=self.name+sep+name,
                 callbacks=self.callbacks,
 use_noise_cluster=use_noise_cluster, use_mua_cluster=use_mua_cluster,
                 is_copy=True,
>                 **params)
E       TypeError: type object got multiple values for keyword argument
'use_mua_cluster'

Reply to this email directly or view it on GitHub: https://github.com/kwikteam/klustakwik2/issues/68

thesamovar commented 8 years ago

OK so I messed that up pretty bad. All fixed now and new release 0.2.4.

thesamovar commented 8 years ago

Also added a new test that will catch any future regressions.