bryancole / raypier_optics

A raytracing toolkit for optical design
Other
58 stars 8 forks source link

Numpy dtype deprecation #15

Closed kameyer226 closed 4 months ago

kameyer226 commented 4 months ago

Hello, @bryancole , thank you so much for this wonderful Python library!

I'm getting the numpy dtype deprecation problem, would you be willing to fix? It feels silly to ask, but it looks like it would be something best done at your discretion.

File "C:\ProgramData\Anaconda3\envs\raypier\Lib\site-packages\raypier\sources.py", line 100, in BaseRaySource view_ray_ids = Trait(None, Array(dtype=numpy.int), transient=True) ^^^^^^^^^ File "C:\ProgramData\Anaconda3\envs\raypier\Lib\site-packages\numpy\__init__.py", line 324, in __getattr__ raise AttributeError(__former_attrs__[attr]) AttributeError: module 'numpy' has no attribute 'int'. np.intwas a deprecated alias for the builtinint. To avoid this error in existing code, useintby itself. Doing this will not modify any behavior and is safe. When replacingnp.int, you may wish to use e.g.np.int64ornp.int32to specify the precision. If you wish to review your current use, check the release note link for additional information. 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: 'inf'?

bryancole commented 4 months ago

Hi,

I just pushed a commit to master which changes numpy.int -> int . I'm not able to test right now, so let me know if this works or not. If there are still problems, I'll take a closer look but it may take me a while (too much other stuff on...).

kameyer226 commented 4 months ago

Works, thank you!