Skip to content

Fix VisibleDeprecation warning by converting float indexes in int

Florent Jaillet requested to merge master into master

As reported in Issue #2 (closed), VisibleDeprecationWarning is raised when indexing array with a non-integer value.

This is solved in two differents ways:

  • when indexing by X/2, changing to X//2 (for any X)
  • when indexing by np.func(X/2), changing to int(np.func(X/2)) (with func being floor or ceil])

Another issue has been found and solved, when reshaping array with non-integer values. this is solved by replacing

new_shape = np.ones((len(cphase.shape), ))

by

new_shape = np.ones((len(cphase.shape), ), dtype=int)

Finally, gcd is now imported from math instead of fractions (DeprecationWarning)

Merge request reports