From 823b97016ce2c06b6f2bd5e1025f6e3b7bcae375 Mon Sep 17 00:00:00 2001 From: Razin Shaikh Date: Mon, 20 Nov 2023 13:36:26 +0100 Subject: [PATCH 1/3] convert string settings to float in proof_to_tikz --- zxlive/tikz.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/zxlive/tikz.py b/zxlive/tikz.py index 237c1b4e..c3ef1a4b 100644 --- a/zxlive/tikz.py +++ b/zxlive/tikz.py @@ -6,13 +6,11 @@ def proof_to_tikz(proof: ProofModel) -> str: settings = QSettings("zxlive", "zxlive") - vspace = settings.value("tikz/layout/vspace") - hspace = settings.value("tikz/layout/hspace") - max_width = settings.value("tikz/layout/max-width") + vspace = float(settings.value("tikz/layout/vspace")) + hspace = float(settings.value("tikz/layout/hspace")) + max_width = float(settings.value("tikz/layout/max-width")) draw_scalar = False - assert isinstance(vspace, float) and isinstance(hspace, float) and isinstance(max_width, float) - xoffset = -max_width yoffset = -10 idoffset = 0 From 6df53d3b3acf14dc122d75026156fd323a38fff6 Mon Sep 17 00:00:00 2001 From: Razin Shaikh Date: Mon, 20 Nov 2023 13:49:44 +0100 Subject: [PATCH 2/3] move custom rules to top, collapsed --- zxlive/proof_panel.py | 1 - zxlive/rewrite_data.py | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/zxlive/proof_panel.py b/zxlive/proof_panel.py index 8e8a2896..bec5d7ca 100644 --- a/zxlive/proof_panel.py +++ b/zxlive/proof_panel.py @@ -401,7 +401,6 @@ def _refresh_rewrites_model(self) -> None: self.rewrites_panel.clicked.connect(model.do_rewrite) # TODO: Right now this calls for every single vertex selected, even if we select many at the same time self.graph_scene.selectionChanged.connect(model.update_on_selection) - self.rewrites_panel.expandAll() class ProofStepItemDelegate(QStyledItemDelegate): diff --git a/zxlive/rewrite_data.py b/zxlive/rewrite_data.py index 555c9a60..b2e7290d 100644 --- a/zxlive/rewrite_data.py +++ b/zxlive/rewrite_data.py @@ -238,6 +238,7 @@ def _extract_circuit(graph: GraphT, matches: list) -> GraphT: rules_zh = {"had2edge", "fuse_hbox", "mult_hbox"} action_groups = { + "Custom rules": {}, "Basic rules": {key: operations[key] for key in rules_basic}, "Graph-like rules": rewrites_graph_theoretic, "ZXW rules": {key: operations[key] for key in rules_zxw}, From e27b0984fffea900a5089cb1c4f06f7ffabfa634 Mon Sep 17 00:00:00 2001 From: Razin Shaikh Date: Mon, 20 Nov 2023 14:34:51 +0100 Subject: [PATCH 3/3] repositioned custom rules tab --- zxlive/rewrite_data.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zxlive/rewrite_data.py b/zxlive/rewrite_data.py index b2e7290d..76de351e 100644 --- a/zxlive/rewrite_data.py +++ b/zxlive/rewrite_data.py @@ -238,8 +238,8 @@ def _extract_circuit(graph: GraphT, matches: list) -> GraphT: rules_zh = {"had2edge", "fuse_hbox", "mult_hbox"} action_groups = { - "Custom rules": {}, "Basic rules": {key: operations[key] for key in rules_basic}, + "Custom rules": {}, "Graph-like rules": rewrites_graph_theoretic, "ZXW rules": {key: operations[key] for key in rules_zxw}, "ZH rules": {key: operations[key] for key in rules_zh},