phy
phy copied to clipboard
Error while running
Hi, I received this error while running Phy on some of the sorted data!
QWidget: Must construct a QApplication before a QWidget zsh: abort phy template-gui params.py
I'm also seeing this error... any suggestions?
$ phy template-gui params.py
File "/software/miniconda3/4.9.2/envs/phy2/lib/python3.7/site-packages/phylib/io/model.py", line 475, in _read_array raise IOError() OSError
QWidget: Must construct a QApplication before a QWidget Aborted (core dumped)
I'm seeing a similar error after installing phy using the Developer instructions in the Readme. Has anyone seen anything like this and solved it?
`(phy) [gg121@compute-e-16-229 phylib]$ phy template-gui /n/groups/datta/guitchounts/data/gmou48/gmou48_2021-12-11_14-24-38_odor/tmp_MS4/phy/params.py
16:41:57.386 [W] model:1325 File /n/groups/datta/guitchounts/data/gmou48/gmou48_2021-12-11_14-24-38_odor/tmp_MS4/phy/None does not exist.
16:41:59.642 [E] init:62 An error has occurred (AssertionError):
Traceback (most recent call last):
File "/home/gg121/anaconda3/envs/phy/bin/phy", line 33, in
QWidget: Must construct a QApplication before a QWidget Aborted`
I saw the same issue. In my case, it was cased by an incorrect params.py, with an entry for n_channels_dat that did not match the data.
Part of the problem here is, the program aborts without a meaningful error message. In order to address this, I've applied this patch
diff --git a/phylib/io/model.py b/phylib/io/model.py
index ad008f5..e755bc9 100644
--- a/phylib/io/model.py
+++ b/phylib/io/model.py
@@ -380,6 +380,9 @@ class TemplateModel(object):
self.channel_mapping = self._load_channel_map()
self.n_channels = nc = self.channel_mapping.shape[0]
if self.n_channels_dat:
+ if not np.all(self.channel_mapping <= self.n_channels_dat - 1):
+ print("channel miss-match, check n_channels_dat in your params file %d,%d\n",self.channel_mapping,self.n_channels_dat)
+ return
assert np.all(self.channel_mapping <= self.n_channels_dat - 1)
# Channel positions.