NelisW / pyradi

a Python toolkit to perform optical and infrared computational radiometry
http://nelisw.github.io/pyradi-docs/_build/html/index.html
MIT License
58 stars 34 forks source link

ryplot.Plotter.polar Type error #23

Open Kaimbelic opened 4 years ago

Kaimbelic commented 4 years ago

I found an issue when trying to use rtplot.Plotter.polar.

`~\pyradi\ryplot.py in polar(self, plotnum, theta, r, ptitle, plotCol, label, labelLocation, highlightNegative, highlightCol, highlightWidth, legendAlpha, linestyle, rscale, rgrid, thetagrid, direction, zerooffset, titlefsize, drawGrid, zorders, clip_on, markers, markevery) 2893 if rgrid[0] is not 0: 2894 numrgrid = (rscale[1] - rscale[0] ) / rgrid[0] -> 2895 ax.set_yticks(np.linspace(rscale[0],rscale[1],numrgrid++1.000001)) 2896 2897 ax.set_ylim(rscale[0],rscale[1])

<__array_function__ internals> in linspace(*args, **kwargs) ~\anaconda3\lib\site-packages\numpy\core\function_base.py in linspace(start, stop, num, endpoint, retstep, dtype, axis) 119 raise TypeError( 120 "object of type {} cannot be safely interpreted as an integer." --> 121 .format(type(num))) 122 123 if num < 0: TypeError: object of type cannot be safely interpreted as an integer.` The issue comes from this part of the code: ` ax.set_yticks(np.linspace(rscale[0],rscale[1],numrgrid++1.000001))` The 3rd argument into `np.linspace()` is a float. Per the documentation of [Numpy 1.18 documentation](https://numpy.org/doc/stable/reference/generated/numpy.linspace.html). The number of samples generated can not be a float. I am not sure if just changing it to 1 is a correct solution either.