I could not view certain columns in Phy, with the latest pre-release. Certain columns were blank. This bug, was discovered by Claude Code. A one line edit fixed the issue and everything rendered correctly. Description below is by Claude Code.
Summary
In phy 2.1.0rc1 (installed via pip install phy --pre), several ClusterView columns render as empty cells: id, sh, depth, amp. Other columns in the same table (ch, fr, n_spikes, Amplitude) display normally. The underlying data is fine — values are present in cluster_info.tsv, and the Waveform/Trace views work — so it's purely a display bug in the new Qt-native table.
Cause
This is the new release-2.1 Qt table (_TableModel(QAbstractTableModel) in phy/gui/widgets.py). data() returns the raw value for DisplayRole without converting numpy scalars:
if role in (Qt.DisplayRole, Qt.EditRole):
return '' if value is None else value
PyQt renders numpy scalars (np.int64/np.float64) as blank. The columns that disappear are exactly the numpy-typed ones — id (cluster_id), sh (model.channel_shanks[best]), depth, amp (np.mean(...)) — while the visible columns happen to be native Python (ch label, fr from a Python division, n_spikes count, Amplitude parsed from TSV).
Repro
pip install phy --pre (lands on 2.1.0rc1, release-2.1 branch)
phy template-gui params.py on any Kilosort/SpikeInterface output
- ClusterView:
id, sh, depth, amp columns are blank.
Suggested fix
Convert numpy scalars to native Python in _TableModel.data():
if role in (Qt.DisplayRole, Qt.EditRole):
if value is None:
return ''
if isinstance(value, np.generic):
value = value.item()
return value
Notes
I could not view certain columns in Phy, with the latest pre-release. Certain columns were blank. This bug, was discovered by Claude Code. A one line edit fixed the issue and everything rendered correctly. Description below is by Claude Code.
Summary
In phy 2.1.0rc1 (installed via
pip install phy --pre), several ClusterView columns render as empty cells:id,sh,depth,amp. Other columns in the same table (ch,fr,n_spikes,Amplitude) display normally. The underlying data is fine — values are present incluster_info.tsv, and the Waveform/Trace views work — so it's purely a display bug in the new Qt-native table.Cause
This is the new
release-2.1Qt table (_TableModel(QAbstractTableModel)inphy/gui/widgets.py).data()returns the raw value forDisplayRolewithout converting numpy scalars:PyQt renders numpy scalars (
np.int64/np.float64) as blank. The columns that disappear are exactly the numpy-typed ones —id(cluster_id),sh(model.channel_shanks[best]),depth,amp(np.mean(...)) — while the visible columns happen to be native Python (chlabel,frfrom a Python division,n_spikescount,Amplitudeparsed from TSV).Repro
pip install phy --pre(lands on 2.1.0rc1, release-2.1 branch)phy template-gui params.pyon any Kilosort/SpikeInterface outputid,sh,depth,ampcolumns are blank.Suggested fix
Convert numpy scalars to native Python in
_TableModel.data():Notes