In Python 3.7.4
with numpy 1.18.0
, when I typed
>>> md = roundmesh(md, 100, 10)
it shows error messages as follows:
Traceback (most recent call last):
File "/home/chpark/spack/opt/spack/linux-ubuntu18.04-skylake_avx512/gcc-9.2.0/python-3.7.4-7sfqaxaatdpsy55drblc2ipnhbyg7gqz/lib/python3.7/site-packages/numpy/core/function_base.py", line 117, in linspace
num = operator.index(num)
TypeError: 'numpy.float64' object cannot be interpreted as an integer
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/chpark/issm/trunk/bin/roundmesh.py", line 27, in roundmesh
theta = np.linspace(0., 2. * np.pi, pointsonedge)
File "<__array_function__ internals>", line 6, in linspace
File "/home/chpark/spack/opt/spack/linux-ubuntu18.04-skylake_avx512/gcc-9.2.0/python-3.7.4-7sfqaxaatdpsy55drblc2ipnhbyg7gqz/lib/python3.7/site-packages/numpy/core/function_base.py", line 121, in linspace
.format(type(num)))
TypeError: object of type <class 'numpy.float64'> cannot be safely interpreted as an integer.
I think that it is because of no type conversion on pointsonedge
variable in roundmesh.py
.
So I suggest following modification in src/m/mesh/roundmesh.py
:
#Get number of points on the circle
pointsonedge = int(np.floor((2. * np.pi * radius) / resolution)) + 1 # + 1 to close the outline