jiffyclub / palettable

Color palettes for Python
https://jiffyclub.github.io/palettable/
Other
768 stars 73 forks source link

adding cartocolors #21

Closed andy-esch closed 7 years ago

andy-esch commented 7 years ago

Porting over the schemes from the CartoColors node module.

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-5.9%) to 89.945% when pulling 4140a1f0c2575e27fb7af4b2b244cd19e6618e8c on andy-esch:add-cartocolors into 2d97c30e7c497db0b51c92c1919dbb801e6c512b on jiffyclub:master.

coveralls commented 7 years ago

Coverage Status

Coverage increased (+0.5%) to 96.332% when pulling 2a1518b7f3e384d8f3d24dfb054ecb276ac34d6a on andy-esch:add-cartocolors into 2d97c30e7c497db0b51c92c1919dbb801e6c512b on jiffyclub:master.

coveralls commented 7 years ago

Coverage Status

Coverage increased (+0.5%) to 96.332% when pulling edad0e8f4c40f483ea9351808c1997d40371321d on andy-esch:add-cartocolors into 2d97c30e7c497db0b51c92c1919dbb801e6c512b on jiffyclub:master.

coveralls commented 7 years ago

Coverage Status

Coverage increased (+0.5%) to 96.332% when pulling edad0e8f4c40f483ea9351808c1997d40371321d on andy-esch:add-cartocolors into 2d97c30e7c497db0b51c92c1919dbb801e6c512b on jiffyclub:master.

coveralls commented 7 years ago

Coverage Status

Coverage increased (+0.5%) to 96.332% when pulling edad0e8f4c40f483ea9351808c1997d40371321d on andy-esch:add-cartocolors into 2d97c30e7c497db0b51c92c1919dbb801e6c512b on jiffyclub:master.

andy-esch commented 7 years ago

@jiffyclub, pretty much finished with the sequential and diverging palettes here. Any advice on handling qualitative palettes?

Also, looks like the py2.7 and pypy tests are failing because they're grabbing a too-new version of IPython. I've had to limit the IPython version in a setup.py to avoid this issue: https://github.com/CartoDB/cartoframes/blob/master/setup.py#L46-L48 Looks like the version needs to be specified in the .travis.yml

coveralls commented 7 years ago

Coverage Status

Coverage increased (+0.5%) to 96.332% when pulling 4c80cbe93acee7fb4ad2b75658e3622af9dee2ae on andy-esch:add-cartocolors into 2d97c30e7c497db0b51c92c1919dbb801e6c512b on jiffyclub:master.

jiffyclub commented 7 years ago

Qualitative maps can be handled in pretty much the same way as the others (e.g. using the same class). For example in the colorbrewer maps I think the only difference between the qualitative palettes and the others is the palette type.

coveralls commented 7 years ago

Coverage Status

Coverage increased (+0.6%) to 96.468% when pulling 9215bbf4e02155956921cb14129189089cfce049 on andy-esch:add-cartocolors into 2d97c30e7c497db0b51c92c1919dbb801e6c512b on jiffyclub:master.

coveralls commented 7 years ago

Coverage Status

Coverage increased (+0.6%) to 96.468% when pulling aeeed6e4ad0d9dc958e71a606e374eb17d8e7fbd on andy-esch:add-cartocolors into 2d97c30e7c497db0b51c92c1919dbb801e6c512b on jiffyclub:master.

andy-esch commented 7 years ago

@jiffyclub, could you do a code review of this? I modeled the new palette structure off of cmocean like you said. Only substantial change is adding a new named argument to utils.get_map_factory that controls how the colors are sampled from the palettes. In my case, the palettes are ordered in the way that the would ideal be sampled (e.g., first three would be a three color palette instead of first, middle, and last like the default).

Let me know if there's anything that you'd like me to change.

coveralls commented 7 years ago

Coverage Status

Coverage increased (+0.6%) to 96.468% when pulling 8dea2e4ef7cf549c20143016050b6bcb5b4a81b0 on andy-esch:add-cartocolors into 2d97c30e7c497db0b51c92c1919dbb801e6c512b on jiffyclub:master.

andy-esch commented 7 years ago

@jiffyclub, any thing else you need from me here?

jiffyclub commented 7 years ago

Thanks for this! I haven't had a chance to review in detail, but will try to get to it soon.

coveralls commented 7 years ago

Coverage Status

Coverage increased (+0.4%) to 96.296% when pulling e9cdea83e39625b3fce76b99de0dff1aff4ba3e7 on andy-esch:add-cartocolors into 2d97c30e7c497db0b51c92c1919dbb801e6c512b on jiffyclub:master.

andy-esch commented 7 years ago

Ok, I added the length check (and verified on my end if it errors correctly if a palette is too short for ones requested to build), and changed the slice to same style as rest of code.

jiffyclub commented 7 years ago

Awesome, thank you! Could you also add a test of the new get_map_factory feature and exception in test_utils.py?

coveralls commented 7 years ago

Coverage Status

Coverage increased (+0.6%) to 96.481% when pulling a6452a1a2e3ebd680afc623ac674ff8d5a7c6f05 on andy-esch:add-cartocolors into 2d97c30e7c497db0b51c92c1919dbb801e6c512b on jiffyclub:master.

andy-esch commented 7 years ago

Yep :) here you go: a6452a1

jiffyclub commented 7 years ago

Thanks, this looks good! I'm going to try to get all the tests passing in Travis before I merge this, but I expect to merge this soon.