flaport / fdtd

A 3D electromagnetic FDTD simulator written in Python with optional GPU support
https://fdtd.readthedocs.io
MIT License
454 stars 116 forks source link

Float128 not supported on Windows #39

Closed Julius-Py closed 2 years ago

Julius-Py commented 2 years ago

I recently installed this on Windows and I'm using Jupyter notebook, It seems to not support the float 128, any thoughts?

AttributeError: module 'numpy' has no attribute 'float128'

flaport commented 2 years ago

Hi @Julius-Py ,

FDTD just uses numpy/pytorch dtypes. It depends on which platform you are on which dtypes are available. There is not much I can do to change this I'm afraid...

pingpongballz commented 2 years ago

Hi @flaport,

I think what @Julius-Py meant was that having numpy.float128 as a dtype in backend.py in windows just causes the fdtd module to fail to initialize, and subsequently returning an error: AttributeError: module 'numpy' has no attribute 'float128'

@Julius-Py, I did a quickfix by just removing any references to numpy.float128 in backend.py and it seemed to do the trick

flaport commented 2 years ago

That's indeed a fair point. I've pushed a fix and this issue will be solved in fdtd>=0.2.4