Loading palettable requires loading setuptools, which is 2.8 MB, and also may not be installed on all systems. This is causing a nontrivial performance penalty for my application because I'm loading palettable on Pyodide (Python compiled to WebAssembly, running in the browser).
This PR removes the dependency on setuptools. Instead of serializing the colorbrewer data to JSON, it saves the data directly as Python code in a .py file. The JSON code is also valid Python code for creating nested dictionaries and lists. I made the change by basically renaming the .json file to .py, and storing the result in a variable.
With this change, there's no need for setuptools, so loading palettable should be faster.
Loading palettable requires loading setuptools, which is 2.8 MB, and also may not be installed on all systems. This is causing a nontrivial performance penalty for my application because I'm loading palettable on Pyodide (Python compiled to WebAssembly, running in the browser).
This PR removes the dependency on setuptools. Instead of serializing the colorbrewer data to JSON, it saves the data directly as Python code in a .py file. The JSON code is also valid Python code for creating nested dictionaries and lists. I made the change by basically renaming the .json file to .py, and storing the result in a variable.
With this change, there's no need for setuptools, so loading palettable should be faster.