chiefenne / PyAero

PyAero is an open-source airfoil contour analysis and CFD meshing tool.
MIT License
171 stars 31 forks source link

PyAero fails to launch with Numpy 1.18.x #2

Closed mepix closed 4 years ago

mepix commented 4 years ago

PyAero fails to launch with NumPy 1.18.x. Reverting back to NumPy 1.17 in a virtual environment resolved the problem.

Traceback (most recent call last):
  File "~/pyaero/lib/python3.6/site-packages/numpy/core/function_base.py", line 117, in linspace
    num = operator.index(num)
TypeError: 'float' object cannot be interpreted as an integer

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "src/PyAero.py", line 303, in <module>
    main()
  File "src/PyAero.py", line 296, in main
    window = MainWindow(app, STYLE)
  File "src/PyAero.py", line 89, in __init__
    self.centralwidget = CentralWidget(self)
  File "src/PyAero.py", line 180, in __init__
    self.toolbox = ToolBox.Toolbox(self.parent)
  File "~/PyAero/src/ToolBox.py", line 55, in __init__
    self.itemBoundaryCondtions()
  File "~/PyAero/src/ToolBox.py", line 266, in itemBoundaryCondtions
    self.valuechange()
  File "~/PyAero/src/ToolBox.py", line 290, in valuechange
    num=num, endpoint=True)
  File "<__array_function__ internals>", line 6, in linspace
  File "~/pyaero/lib/python3.6/site-packages/numpy/core/function_base.py", line 121, in linspace
    .format(type(num)))
TypeError: object of type <class 'float'> cannot be safely interpreted as an integer.

It seems NumPy 1.18+ now expects more explicit conversion between floats and ints before calling linspace.

chiefenne commented 4 years ago

Thanks for the info. The bug was as you described that I didn't use type integer for the "num" parameter in numpy.linspace. Fixed now.