fix: rename validity system argument to category - #58
Merged
Conversation
The validity-file schema key, `Catalog.get_files`, and the internal catalog storage already use `category`, but `TextDB.on` and `Catalog.valid_for` exposed the same concept as `system`. Rename the argument to `category` everywhere so the whole validity API speaks one name. `system=` stays as a deprecated keyword-only alias that emits a DeprecationWarning, so existing keyword callers keep working; positional callers are unaffected since the argument position is unchanged.
Add a project skill under .claude/skills documenting how to load, query, and verify dbetto-format text databases with the TextDB / AttrsDict / Catalog / Props API, plus a reference on validity files (modes, category resolution, the legacy JSONL variant, and the low-level Catalog API).
Point Claude Code at the existing AGENTS.md contributor instructions via a CLAUDE.md import directive, so both toolchains share one source of guidance.
Owner
Author
Add a `dbetto-tools` marketplace manifest (.claude-plugin/marketplace.json)
and a plugin manifest for the inspect-textdb skill, so the skill can be
installed from the remote repo without cloning it:
/plugin marketplace add gipert/dbetto
/plugin install inspect-textdb@dbetto-tools
The plugin reuses the existing .claude/skills/inspect-textdb folder as its
source. Validated with `claude plugin validate` and an end-to-end local
add/install/uninstall round-trip.
Extract the `system` -> `category` deprecation shim into a shared `_resolve_category_alias` helper in catalog.py, reused by both `Catalog.valid_for` and `TextDB.on`. Removes the duplicated block that tripped pylint's duplicate-code check (R0801).
Drop the stale OpenAI Codex section and note that `nox -s lint` runs only the pre-commit hooks, while PyLint (`nox -s pylint`) and the bare `nox` run are what CI additionally enforces. Mypy is manual-stage and not run by lint.
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.
The validity axis (
phy/cal/lar/all…) was referred to by two different names depending on where you looked incatalog.py, even though it is a single concept. The serialized field andCatalog.get_filesusecategory, butTextDB.onandCatalog.valid_forexposed the same thing assystem, and the internalbuild_catalog/save_format/write_tocode oscillated between the two.They are genuinely the same axis, not two filters:
build_catalogreads the label only from the filecategoryfield (system = props.get("category", "all")) and keysself.entriesby it, whilevalid_forlooks itssystemargument up in that same dict."system"is never read from the data anywhere; it existed purely as a parameter/variable name.This PR makes the whole validity API speak one name,
category(the name users already see in their files and inget_files):TextDB.on(..., category="all")andCatalog.valid_for(..., category="all").system/systvariables inbuild_catalog,get_dict_format,write_to, andEntry.save_formatrenamed tocategory.category=.Backward compatibility
system=is kept as a deprecated keyword-only alias that emits aDeprecationWarning; positional callers are unaffected since the argument position is unchanged. Downstream code (e.g. pylegendmeta, legend-dataflow) keeps working, but should migratesystem=→category=; the alias can be removed in a future major release.New tests cover the alias via
pytest.deprecated_call().Notes
Unrelated to this axis, detector/channel-map records may carry a data field literally named
system(e.g.system: geds);Catalognever touches it, so it is untouched here.