Skip to content

Drop dead jsonpath_rw dependency and vendor Lab→sRGB conversion (closes #287) - #288

Merged
Robbie1977 merged 1 commit into
masterfrom
fix/287-drop-legacy-deps
Aug 26, 2026
Merged

Robbie1977 merged 1 commit into
masterfrom
fix/287-drop-legacy-deps

Conversation

@Robbie1977

Copy link
Copy Markdown
Contributor

Closes #287.

What

  • Remove jsonpath_rw from the requirements (pyproject.toml + requirements.txt) and delete its commented-out import in neo/query_wrapper.py. It was a dead dependency — nothing in the codebase uses it — but as an unmaintained 2015 sdist it could break installs on runtimes with unhealthy setuptools state (seen on a Google Colab py3.13 runtime).
  • Remove the colormath dependency (same era, unmaintained, numpy-2-brittle). Its only use was the Lab→sRGB step in VfbConnect.generate_lab_colors; that conversion is now vendored in a new ~60-line, numpy-only module vfb_connect/color_conversion.py reproducing colormath's pipeline exactly (Lab D50 → XYZ → Bradford adaptation to D65 → linear sRGB → gamma, clamped).

Verification

  • Vendored conversion vs colormath.convert_color(LabColor, sRGBColor): max 8-bit channel difference of 0 over 500 random Lab points and a 567-point grid.
  • New offline unit tests (test/color_conversion_test.py): reference values generated with colormath 3.0.0, plus a clamping sweep — no network, no colormath needed to run them.
  • Fresh py3.13 venv: pip install . succeeds; Requires: no longer lists colormath/jsonpath_rw; vfb.generate_lab_colors(6) returns valid distinct RGB tuples end-to-end against live VFB.

Why it matters

pip install vfb-connect no longer builds any legacy setup.py-only sdist, which removes the failure mode behind the old setuptools<58 workaround entirely (that pin is itself broken on Python ≥3.12). Downstream, the NeuroFly workshop notebooks can drop their --use-pep517 belt-and-braces line once this is released.

Remove jsonpath_rw from install requirements: its only import was already
commented out, so it was a pure install liability (unmaintained 2015 sdist
whose legacy setup.py build fails on some runtimes).

Replace the colormath dependency (same era, also unmaintained and
numpy-2-brittle) with a ~60-line vendored Lab(D50)->sRGB conversion in
color_conversion.py reproducing colormath's pipeline exactly: Lab -> XYZ ->
Bradford adaptation to D65 -> linear sRGB -> gamma, clamped. Verified
identical to colormath over 500 random Lab points (max 8-bit channel
difference 0); offline unit tests included.

Fixes #287
@Robbie1977
Robbie1977 merged commit db81a21 into master Aug 26, 2026
10 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Drop dead jsonpath_rw dependency (unmaintained sdist, breaks installs on stale runtimes); colormath also legacy

1 participant