Coder Social home page Coder Social logo

Python 3 support about chroma HOT 5 OPEN

seenaburns avatar seenaburns commented on August 24, 2024
Python 3 support

from chroma.

Comments (5)

lyneca avatar lyneca commented on August 24, 2024 1

Bump :(

from chroma.

scls19fr avatar scls19fr commented on August 24, 2024
    except Exception, e:
        raise ValueError('Invalid Hex Input: %s' % (color_value))

should be changed to

    except Exception as e:
        raise ValueError('Invalid Hex Input: %s' % (color_value))

but some unit tests are still failling

$ nosetests -s -v
Test alpha support / no-support with various color systems ... ok
Test input that goes beyond color system bounds ... ERROR
Test additive and subtractive mixing ... ok
Test construction of color object ... ERROR
Test equality and inequality ... ok
Test conversion between systems ... ERROR

======================================================================
ERROR: Test input that goes beyond color system bounds
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/scls/github/scls19fr/Chroma/tests/test_chroma.py", line 82, in test_bad_input
    self.assertEqual(chroma.Color((300, -3, 50), 'RGB256').rgb256, chroma.Color((255, 0, 50), 'RGB256').rgb256)
  File "/Users/scls/github/scls19fr/Chroma/chroma/core.py", line 35, in __init__
    self.rgb256 = color_value
  File "/Users/scls/github/scls19fr/Chroma/chroma/core.py", line 103, in rgb256
    self.rgb = map(lambda x: x / 255.0, color_tuple)
  File "/Users/scls/github/scls19fr/Chroma/chroma/core.py", line 95, in rgb
    self.color = tuple(map(self._apply_float_bounds, color_tuple[:3]))
TypeError: 'map' object is not subscriptable

======================================================================
ERROR: Test construction of color object
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/scls/github/scls19fr/Chroma/tests/test_chroma.py", line 38, in test_color_initialization
    self.assertEqual(chroma.Color((255, 255, 255), 'RGB256').hex, white)
  File "/Users/scls/github/scls19fr/Chroma/chroma/core.py", line 35, in __init__
    self.rgb256 = color_value
  File "/Users/scls/github/scls19fr/Chroma/chroma/core.py", line 103, in rgb256
    self.rgb = map(lambda x: x / 255.0, color_tuple)
  File "/Users/scls/github/scls19fr/Chroma/chroma/core.py", line 95, in rgb
    self.color = tuple(map(self._apply_float_bounds, color_tuple[:3]))
TypeError: 'map' object is not subscriptable

======================================================================
ERROR: Test conversion between systems
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/scls/github/scls19fr/Chroma/tests/test_chroma.py", line 64, in test_system_conversion
    self.assertTupleAlmostEqual(chroma.Color((51, 85, 119), 'RGB256').rgb, self.c1.rgb)
  File "/Users/scls/github/scls19fr/Chroma/chroma/core.py", line 35, in __init__
    self.rgb256 = color_value
  File "/Users/scls/github/scls19fr/Chroma/chroma/core.py", line 103, in rgb256
    self.rgb = map(lambda x: x / 255.0, color_tuple)
  File "/Users/scls/github/scls19fr/Chroma/chroma/core.py", line 95, in rgb
    self.color = tuple(map(self._apply_float_bounds, color_tuple[:3]))
TypeError: 'map' object is not subscriptable

----------------------------------------------------------------------
Ran 6 tests in 0.015s

FAILED (errors=3)

from chroma.

scls19fr avatar scls19fr commented on August 24, 2024

Pinging @aerickson

from chroma.

scls19fr avatar scls19fr commented on August 24, 2024
@rgb256.setter
def rgb256(self, color_tuple):
    self.rgb = map(lambda x: x / 255.0, color_tuple)

should be

@rgb256.setter
def rgb256(self, color_tuple):
    self.rgb = tuple(map(lambda x: x / 255.0, color_tuple))

from chroma.

aerickson avatar aerickson commented on August 24, 2024

@lyneca Until it's merged you can install a pip from a git source. Just use a fork with the code you want.

https://stackoverflow.com/questions/16584552/how-to-state-in-requirements-txt-a-direct-github-source

from chroma.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.