Repository navigation
Move url configs to strax - #1020
Open
WenzDaniel wants to merge 7 commits into
Open
WenzDaniel wants to merge 7 commits into
WenzDaniel wants to merge 7 commits into
Conversation
1 of 3 tasks
WenzDaniel
marked this pull request as ready for review
November 5, 2026 09:15
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.
What is the problem / what does the code in this PR do
In this PR we move the URL config engine from straxen to strax. This allows packages to be independent of straxen. For example when developing a straxen-like package for a local TPC. We do not moce any of the already existing protocols yet.
This PR only works in combination with straxen PR #1686.
What changed
strax/utils.py: three generic helpers moved over fromstraxen/misc.py:filter_kwargs,CacheDictandtotal_size. The code is unchanged.strax/url_config.py(new):URLConfig,clear_config_cachesandconfig_cache_size_mb, copied fromstraxen/config/url_config.py. The only changes are imports. pydantic is imported frompydantic.v1when that exists, and frompydanticotherwise. Both give the same v1 validation, so pydantic 1.10 and 2.x both work.strax/__init__.py: exports the new module (afterconfig, becauseURLConfigsubclassesstrax.Config).pyproject.toml: addspydantic >= 1.10as a dependency. straxen has relied on pydantic so far without declaring it; it was only installed through xedocs.strax.url_config.tests/test_url_config.pyadds 36 tests. They cover registration, preprocessor precedence, URL/AST conversion, keyword-argument filtering, type validation, caching, dry evaluation, and the fact that the lineage stores the URL and not its value.strax.URLConfigregistry.tests/test_utils.pyadds 3 tests for the helpers.Compatibility
URLConfig.straxen.test_utils.nt_test_context("xenonnt")are identical before and after. The registered protocols and preprocessors are also identical.