Adapt to NumPy 2.0 namespace changes: np.inf and np.nan
Adapt to NumPy 2.0 namespace changes: np.inf and np.nan

NumPy 2.0 introduces namespace changes that deprecate certain ways of accessing special values like np.inf and np.nan.

All instances where np.Inf and np.infty (aliases for np.inf), np.NINF (equivalent to -np.inf), or np.NaN (equivalent to np.nan) are used have been updated to their canonical forms, ensuring compatibility with NumPy 2.0.

See https://numpy.org/devdocs/numpy_2_0_migration_guide.html#changes-to-namespaces.
