chongxi / spiketag

Next generation of spike sorting package for BMI
BSD 3-Clause "New" or "Revised" License
6 stars 4 forks source link

Add `clu.fill` and `clu.changed` to save code and time #25

Closed chongxi closed 5 years ago

chongxi commented 5 years ago
  1. to update clustering assignment simply call clu.fill(label)
  2. to check whether cluster changed, simply call clu.changed

PS: clu.changed is a @property, which compare the new membership with the last in the stack: self._membership_stack.append(self.membership.copy())

A python tip: copy() here is critical, otherwise when the external membership changes, the value in the stack will also change.