Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX: show only selected rules in DOT rendering #225

Merged
merged 2 commits into from
Jul 8, 2023

Conversation

redeboer
Copy link
Member

@redeboer redeboer commented Jul 8, 2023

Previously, a DOT rendering of a ProblemSet rendered only rule_priorities. This is, however, just an exhaustive list of priorities for each rule that are in most cases the default rule prioties, not a list of selected rules for each node or edge. This fix renders the selected conservation_rules instead:

Code snippet
import graphviz

import qrules
from qrules.settings import InteractionType
from qrules.transition import StateTransitionManager

stm = StateTransitionManager(
    initial_state=["Lambda(c)+"],
    final_state=["p", "K-", "pi+"],
    mass_conservation_factor=0.6,
)
stm.set_allowed_interaction_types([InteractionType.WEAK], node_id=0)
stm.set_allowed_interaction_types([InteractionType.STRONG], node_id=1)
problem_sets = stm.create_problem_sets()
problem_set, *_ = problem_sets.values()
src = qrules.io.asdot(problem_set[0], render_node=True)
graphviz.Source(src)

Before

before

After

after

@redeboer redeboer added the 🐛 Bug Something isn't working label Jul 8, 2023
@redeboer redeboer self-assigned this Jul 8, 2023
@redeboer redeboer marked this pull request as ready for review July 8, 2023 19:26
@redeboer redeboer enabled auto-merge (squash) July 8, 2023 19:26
@redeboer redeboer merged commit f35316b into ComPWA:main Jul 8, 2023
@redeboer redeboer deleted the render-selected-rules branch July 8, 2023 20:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant