Skip to content

BREAK: merge collapse flags into one argument - #365

Draft
Flomber wants to merge 7 commits into
mainfrom
collapse-interaction
Draft

BREAK: merge collapse flags into one argument#365
Flomber wants to merge 7 commits into
mainfrom
collapse-interaction

Conversation

@Flomber

@Flomber Flomber commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

⚠️ Interface changes

The boolean flags strip_spin and collapse_graphs on qrules.io.asdot() and qrules.io.asmermaid() are replaced by a single collapse argument that takes "spin", "topology", or None. The two booleans described mutually exclusive ways of combining transitions, but nothing in the signature said so: strip_spin=True, collapse_graphs=True was accepted by the type checker and only rejected at runtime. A single enumerated argument makes the exclusivity part of the interface, and the new CollapseMode alias (exported as qrules.io.CollapseMode) names the accepted values.

Old name New name
strip_spin=True collapse="spin"
collapse_graphs=True collapse="topology"

🔨 Maintenance

  • The branching that selects how transitions are combined lived twice, once in GraphvizPrinter and once in MermaidPrinter. It now lives in a single _labels.prepare_transitions() helper that both printers call, which also removes the attrs on_setattr validator that used to guard the mutually exclusive booleans.
  • GraphvizPrinter is now kw_only, matching MermaidPrinter.

Squash commit messages

* MAINT: centralize transition collapsing in prepare_transitions
* MAINT: make GraphvizPrinter keyword-only

@Flomber Flomber added this to the 0.11.0 milestone Aug 31, 2026
@Flomber
Flomber requested a review from redeboer August 31, 2026 17:41
@Flomber Flomber self-assigned this Aug 31, 2026
@Flomber Flomber added 🐛 Bug Something isn't working ❗ Behavior Changes that may affect the framework output labels Aug 31, 2026
@Flomber

Flomber commented Aug 31, 2026

Copy link
Copy Markdown
Contributor Author

I accidentally branched from mermaid-switch and thereby took all previous commits with me... 😞
Can we fix this, or do we have to create a new pull request for that?

@Flomber

Flomber commented Aug 31, 2026

Copy link
Copy Markdown
Contributor Author

We once talked about implementing a validator for both MermaidPrinter and GraphvizPrinter.
We might want to talk about this again in person? 🤔

@redeboer
redeboer changed the base branch from main to mermaid-switch August 31, 2026 19:13
@redeboer
redeboer force-pushed the collapse-interaction branch from f9b9a32 to 4d3b074 Compare August 31, 2026 20:02
@redeboer redeboer changed the title Clarify collapse functionality in rendering BREAK: merge collapse flags into one argument Aug 31, 2026
@redeboer redeboer added 🔨 Maintenance Maintenance and upkeep improvements ⚠️ Interface Breaking changes to the API and removed 🐛 Bug Something isn't working ❗ Behavior Changes that may affect the framework output labels Aug 31, 2026
@redeboer
redeboer force-pushed the collapse-interaction branch from 4d3b074 to 9e684e9 Compare August 31, 2026 20:10
Base automatically changed from mermaid-switch to main September 2, 2026 13:13
@Flomber
Flomber force-pushed the collapse-interaction branch from 2db7e37 to 87547f1 Compare September 2, 2026 13:13
@redeboer
redeboer force-pushed the collapse-interaction branch from 4df80cc to 51fc858 Compare September 4, 2026 12:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

⚠️ Interface Breaking changes to the API 🔨 Maintenance Maintenance and upkeep improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Clarify the interaction between strip_spin and collapse_graphs

2 participants