You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I've been using phidl for a bit now and wanted to create a ground plane for waveguides using phidl.geometry.fill_rectangle. However, I get a numpy error - apparently, since numpy 1.20.0, np.bool as a datatype is deprecated. Here's a quick program recreating the issue :
I am running numpy 1.24.3 in a conda environment. When running the Python script above, I get the following error :
C:\Users\XXXX\AppData\Local\miniconda3\envs\stage-m2\Lib\site-packages\phidl\geometry.py:3776: FutureWarning: In the future `np.bool` will be defined as the corresponding NumPy scalar.
raster = np.zeros((ysize, xsize), dtype=np.bool)
Traceback (most recent call last):
File "C:\Users\XXXX\Documents\Stage M2\chip-design\v0\mvbr.py", line 25, in <module>
gp = chip << pg.fill_rectangle(D = chip,
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\XXXX\AppData\Local\miniconda3\envs\stage-m2\Lib\site-packages\phidl\geometry.py", line 3981, in fill_rectangle
raster = _rasterize_polygons(
^^^^^^^^^^^^^^^^^^^^
File "C:\Users\XXXX\AppData\Local\miniconda3\envs\stage-m2\Lib\site-packages\phidl\geometry.py", line 3776, in _rasterize_polygons
raster = np.zeros((ysize, xsize), dtype=np.bool)
^^^^^^^
File "C:\Users\XXXX\AppData\Local\miniconda3\envs\stage-m2\Lib\site-packages\numpy\__init__.py", line 305, in __getattr__
raise AttributeError(__former_attrs__[attr])
AttributeError: module 'numpy' has no attribute 'bool'.
`np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here.
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations. Did you mean: 'bool_'?
Lou
The text was updated successfully, but these errors were encountered:
Hello, I've been using phidl for a bit now and wanted to create a ground plane for waveguides using
phidl.geometry.fill_rectangle
. However, I get a numpy error - apparently, since numpy 1.20.0,np.bool
as a datatype is deprecated. Here's a quick program recreating the issue :I am running numpy 1.24.3 in a conda environment. When running the Python script above, I get the following error :
Lou
The text was updated successfully, but these errors were encountered: