Skip to content

Commit d22cbb5

Browse files
committed
[audian] small improvements to the handling of analyzers
1 parent 1243d06 commit d22cbb5

2 files changed

Lines changed: 10 additions & 5 deletions

File tree

src/audian/audian.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1533,15 +1533,15 @@ def audian_cli(cargs=[], plugins=None):
15331533

15341534

15351535
def main(cargs):
1536+
mp.set_start_method('forkserver' if os.name == 'posix' else 'spawn')
1537+
AudioLoader.max_open_files = os.cpu_count() + 2
1538+
AudioLoader.max_open_loaders = 2*AudioLoader.max_open_files
15361539
plugins = Plugins()
15371540
plugins.load_plugins()
15381541
audian_cli(cargs, plugins)
15391542

15401543

15411544
def run():
1542-
mp.set_start_method('forkserver' if os.name == 'posix' else 'spawn')
1543-
AudioLoader.max_open_files = os.cpu_count() + 2
1544-
AudioLoader.max_open_loaders = 2*AudioLoader.max_open_files
15451545
main(sys.argv[1:])
15461546

15471547

src/audian/databrowser.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1763,7 +1763,9 @@ def analyze_region(self, t0, t1, channel):
17631763
if self.analysis_table is None:
17641764
self.analysis_results()
17651765
else:
1766-
self.analysis_table.setData(self.get_analysis_table())
1766+
table = self.get_analysis_table()
1767+
if len(table) > 0:
1768+
self.analysis_table.setData(table)
17671769

17681770

17691771
def get_analysis_table(self):
@@ -1789,13 +1791,16 @@ def analysis_results(self):
17891791
return
17901792
if len(self.analyzers) == 0:
17911793
return
1794+
table = self.get_analysis_table()
1795+
if len(table) == 0:
1796+
return
17921797
dialog = QDialog(self)
17931798
dialog.setWindowTitle('Audian analyis table')
17941799
vbox = QVBoxLayout()
17951800
dialog.setLayout(vbox)
17961801
self.analysis_table = pg.TableWidget()
17971802
self.analysis_table.setMinimumHeight(250)
1798-
self.analysis_table.setData(self.get_analysis_table())
1803+
self.analysis_table.setData(table)
17991804
c = 0
18001805
for a in self.analyzers:
18011806
for i in range(a.data.columns()):

0 commit comments

Comments
 (0)