Skip to content

Index in ciexyz.xyz_from_wavelength() should be explicitly converted to int. #23

Open

Description

@markkness

The index used in ciexyz.xyz_from_wavelength() is intended to be an integer, but is actually a floating point type with an integral value. It should be explicitly converted to an integer to avoid a deprecation warning.

Activity

  1. jmllorens commented on May 12, 2017

    @jmllorens

    In my case, I directly get IndexError. Would be great to get it fixed.

  2. thecere commented on Jun 4, 2017

    @thecere

    It's an error in numpy 1.12.x now:

    File "/vls/lib/python2.7/site-packages/colorpy/ciexyz.py", line 709, in xyz_from_wavelength
        return _xyz_colors [index] + frac_wl_nm * _xyz_deltas [index]
    IndexError: only integers, slices (`:`), ellipsis (`...`), numpy.newaxis (`None`) and integer or boolean arrays are valid indices
    
  3. GordonDongZHAO commented on Dec 12, 2019

    @GordonDongZHAO

    index = int(index)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions