Repository navigation
Drop dead jsonpath_rw dependency and vendor Lab→sRGB conversion (closes #287) - #288
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #287.
What
jsonpath_rwfrom the requirements (pyproject.toml+requirements.txt) and delete its commented-out import inneo/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).colormathdependency (same era, unmaintained, numpy-2-brittle). Its only use was the Lab→sRGB step inVfbConnect.generate_lab_colors; that conversion is now vendored in a new ~60-line, numpy-only modulevfb_connect/color_conversion.pyreproducing colormath's pipeline exactly (Lab D50 → XYZ → Bradford adaptation to D65 → linear sRGB → gamma, clamped).Verification
colormath.convert_color(LabColor, sRGBColor): max 8-bit channel difference of 0 over 500 random Lab points and a 567-point grid.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.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-connectno longer builds any legacysetup.py-only sdist, which removes the failure mode behind the oldsetuptools<58workaround entirely (that pin is itself broken on Python ≥3.12). Downstream, the NeuroFly workshop notebooks can drop their--use-pep517belt-and-braces line once this is released.