Skip to content

perf: load Munsell color reference CSV once at startup#363

Open
johannesparty wants to merge 1 commit intomainfrom
fix/cache-munsell-csv-at-startup
Open

perf: load Munsell color reference CSV once at startup#363
johannesparty wants to merge 1 commit intomainfrom
fix/cache-munsell-csv-at-startup

Conversation

@johannesparty
Copy link

This is not a critical change, but it does make things more efficient and it isn't particularly complicated.

The 8,500-row CSV was being read on every call to list_soils(). Now loaded once at module level in config.py. Also precompute the numpy array for LAB_ref and use np.argmin instead of pd.DataFrame.idxmin in lab2munsell to avoid repeated pandas overhead.

Not really sure if want the changes in .pre-commit-config.yaml, but let's see how the automated tests go.

The 8,500-row CSV was being read on every call to list_soils(). Now
loaded once at module level in config.py. Also precompute the numpy
array for LAB_ref and use np.argmin instead of pd.DataFrame.idxmin
in lab2munsell to avoid repeated pandas overhead.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@johannesparty johannesparty requested a review from garobrik March 19, 2026 18:15
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.

1 participant