Skip to content

[dependencies] Remove colormap/easydev dependency in favour of stdlib colorsys #626

Description

@dancasey-ie

Is your feature request related to a problem? Please describe.
colormap is a hard dependency (setup.py line 59) used in only three places in brightwind/analyse/plot.pyrgb2hls/hls2rgb at lines 295-296 and 1566 (the rgb2hex imported at line 16 appears unused). colormap pulls in easydev, which in turn drags in colorlog, line-profiler (a compiled package), pexpect, platformdirs and colorama — a large, partly-compiled subtree just for two colour-space conversions.

Describe the solution you'd like
Replace the colormap calls with Python's standard-library colorsys (which is what colormap wraps — results are identical):

  • rgb2hls(r, g, b)colorsys.rgb_to_hls(r, g, b) (same 0-1 convention)
  • hls2rgb(h, l, s)colorsys.hls_to_rgb(h, l, s)
  • if rgb2hex is genuinely needed, use matplotlib.colors.to_hex (matplotlib is already core) or a one-line format string.

Then drop colormap and easydev from install_requires and requirements.txt.

Describe alternatives you've considered
Keeping colormap but pinning it — rejected: it still pulls the easydev/line-profiler tree for no benefit.

Additional context
Removes roughly six transitive packages (including a compiled one) from every install, and eliminates a source-build risk on older toolchains (e.g. the Amazon Linux 2 / GCC 7.3.1).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions