Skip to content

Add --list-operations flag; rewrite Multi-Source Rules README section - #121

Merged
matthewhorridge merged 2 commits into
mainfrom
feat/list-operations
Jul 9, 2026
Merged

Add --list-operations flag; rewrite Multi-Source Rules README section#121
matthewhorridge merged 2 commits into
mainfrom
feat/list-operations

Conversation

@matthewhorridge

Copy link
Copy Markdown
Contributor

Summary

  • harmonize --list-operations prints each available primitive operation with the first paragraph of its class docstring, so the listing can never drift from the implemented primitives
  • The factory's 50-line match statement is replaced by an explicit OPERATION_CLASSES registry that both deserialization and the listing dispatch through
  • --rules is no longer required by argparse; it is enforced in main() for the validate and harmonize modes
  • Rewrites the Multi-Source Rules README section in plainer language: leads with the two concrete data situations (value in different columns depending on units; one measurement split across columns), walks through each YAML example row by row with inline comments, and splits case / coalesce / multi-operand branches into their own subsections

Sample output:

bin
  Assign values into histogram bins. Performs a range query using an interval
  tree. Bins must not overlap.

case
  Choose one of several branches by switching on a selector source, then
  compute that branch's value from one or more source operands.
...

Test plan

  • 6 new tests: registry covers the full vocabulary, every class has help text, list mode output, and --rules enforcement for both remaining modes
  • pytest tests — 221 passed
  • All complete YAML rule examples in the README (including the new commented ones) load through RuleSet.load

🤖 Generated with Claude Code

matthewhorridge and others added 2 commits July 9, 2026 10:50
'harmonize --list-operations' prints each available operation with the
first paragraph of its class docstring, so the listing always matches
the implemented primitives. The factory's match statement is replaced
by an explicit OPERATION_CLASSES registry that both deserialization
and the listing dispatch through.

--rules is no longer required by argparse; it is enforced in main()
for the validate and harmonize modes.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Lead with the two concrete data situations the feature addresses,
walk through each YAML example row by row with inline comments, and
split case / coalesce / multi-operand branches into their own
subsections. Also document --list-operations in the CLI notes.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@matthewhorridge
matthewhorridge merged commit f6556dc into main Jul 9, 2026
1 check passed
@matthewhorridge
matthewhorridge deleted the feat/list-operations branch July 9, 2026 17:51
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