REDPy
REDPy copied to clipboard
Suggestion: Use numpy.zeros() instead of scipy.zeros() for initializing boolean arrays
https://github.com/ahotovec/REDPy/blob/c38ddf5e34e9f2ca82e0e6a2172e88e21b387398/redpy/optics.py#L24
In this line:
self._processed = scipy.zeros((self._n, 1), dtype=bool)
it's recommended to use numpy.zeros() directly:
self._processed = numpy.zeros((self._n, 1), dtype=bool)
scipy.zeros() is just a thin wrapper around numpy.zeros() and introduces unnecessary overhead. For performance, readability, and consistency, it's best to use numpy.zeros() directly, which is the standard and widely adopted practice.