Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version on pypi doesn't have commit "don't use bd.float directly for type casting" and is erroring #60

Closed
kyjohnso opened this issue Feb 2, 2023 · 1 comment

Comments

@kyjohnso
Copy link

kyjohnso commented Feb 2, 2023

Version 0.2.6 on pypi doesn't have the commit 3cb63c27455e3f038dbd26b1394549a156 to "don't use bd.float directly for type casting". Without this commit, the initialization of a grid with any of the "torch" backends errors:

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Cell In[8], line 1
----> 1 grid = fdtd.Grid(
      2     (2.5e-5, 1.5e-5, 1),
      3     grid_spacing=0.01 * WAVELENGTH,
      4     permittivity=1.0,
      5     permeability=1.0,
      6 )

File ~/projects/compem/venv/lib/python3.10/site-packages/fdtd/grid.py:143, in Grid.__init__(self, shape, grid_spacing, permittivity, permeability, courant_number)
    141 if bd.is_array(permittivity) and len(permittivity.shape) == 3:
    142     permittivity = permittivity[:, :, :, None]
--> 143 self.inverse_permittivity = bd.ones((self.Nx, self.Ny, self.Nz, 3)) / bd.float(
    144     permittivity
    145 )
    147 if bd.is_array(permeability) and len(permeability.shape) == 3:
    148     permeability = permeability[:, :, :, None]

TypeError: 'torch.dtype' object is not callable

Do you plan to push a new version to pypi?

python 3.10.6 (main, Nov 14 2022, 16:10:14) [GCC 11.3.0]
torch 1.13.1+cu117

@kyjohnso kyjohnso changed the title Version on pypi doesn't have commit 3cb63c27455e3f038dbd26b1394549a156 Version on pypi doesn't have commit "don't use bd.float directly for type casting" and is erroring Feb 2, 2023
@flaport
Copy link
Owner

flaport commented Feb 2, 2023

Thanks for the reminder @kyjohnso . This should now be fixed by fdtd version 0.2.7.

@flaport flaport closed this as completed Feb 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants