chipmuenk / pyfda

Python Filter Design Analysis Tool
http://chipmuenk.github.io/
MIT License
648 stars 93 forks source link

Unhandeled IndexError #243

Closed hantangantan closed 11 months ago

hantangantan commented 11 months ago

It is possible to delete the whole parameter table for P/Z and b,a, which results in an IndexError:

Traceback (most recent call last):
  File "C:\dev\python\pyfda\pyfda_venv\Lib\site-packages\pyfda\input_widgets\input_coeffs.py", line 940, in _delete_cells
    self.refresh_table()
  File "C:\dev\python\pyfda\pyfda_venv\Lib\site-packages\pyfda\input_widgets\input_coeffs.py", line 606, in refresh_table
    self.ba[1][0] = 1.0  # restore a[0] = 1 of denominator polynome
    ~~~~~~~~~~^^^
IndexError: index 0 is out of bounds for axis 0 with size 0

Reproduce:

Start pyfda Select b,a or P/Z tab (leftside) Select all cells (rows and columns) Klick on Delete Button (next to clear button)

chipmuenk commented 11 months ago

Confirmed and fixed in develop branch - thanks for reporting!