From 7323a4f88b5e6f2028ffea6238175e19367ace47 Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Mon, 16 Jan 2023 11:26:10 -0600 Subject: [PATCH] better --- .../notebooks/Example_Rank4-bundled.ipynb | 16 ++++++++-------- sparsetensorviz/sparsetensorviz/_bundle.py | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/sparsetensorviz/notebooks/Example_Rank4-bundled.ipynb b/sparsetensorviz/notebooks/Example_Rank4-bundled.ipynb index 6e6d416..b482e50 100644 --- a/sparsetensorviz/notebooks/Example_Rank4-bundled.ipynb +++ b/sparsetensorviz/notebooks/Example_Rank4-bundled.ipynb @@ -639,7 +639,7 @@ "def to_tim(st):\n", " rv = []\n", " for gp in st.bundled_groups:\n", - " if \"expanded=True\" in gp:\n", + " if \"expanded=\" in gp:\n", " return\n", " num = int(gp[:-1].split(\"(\", 1)[1])\n", " if gp.startswith(\"Coord\"):\n", @@ -2632,7 +2632,7 @@ "data": { "text/markdown": [ "```\n", - "bundled_groups = [Coord(2, expanded=True), Sparse(1), Coord(1)]\n", + "bundled_groups = [Coord(2, expanded=1), Sparse(1), Coord(1)]\n", "\n", "tim_structure = N/A\n", "\n", @@ -2937,7 +2937,7 @@ "data": { "text/markdown": [ "```\n", - "bundled_groups = [Coord(1, expanded=True), Sparse(1), Coord(2)]\n", + "bundled_groups = [Coord(1, expanded=1), Sparse(1), Coord(2)]\n", "\n", "tim_structure = N/A\n", "\n", @@ -3241,7 +3241,7 @@ "data": { "text/markdown": [ "```\n", - "bundled_groups = [Coord(1, expanded=True), Sparse(2), Coord(1)]\n", + "bundled_groups = [Coord(1, expanded=1), Sparse(2), Coord(1)]\n", "\n", "tim_structure = N/A\n", "\n", @@ -3611,7 +3611,7 @@ "data": { "text/markdown": [ "```\n", - "bundled_groups = [Coord(1, expanded=True), Sparse(1), HyperSparse(1), Coord(1)]\n", + "bundled_groups = [Coord(1, expanded=1), Sparse(1), HyperSparse(1), Coord(1)]\n", "\n", "tim_structure = N/A\n", "\n", @@ -4403,7 +4403,7 @@ "data": { "text/markdown": [ "```\n", - "bundled_groups = [Sparse(1), Coord(1, expanded=True), Sparse(1), Coord(1)]\n", + "bundled_groups = [Sparse(1), Coord(1, expanded=1), Sparse(1), Coord(1)]\n", "\n", "tim_structure = N/A\n", "\n", @@ -6611,7 +6611,7 @@ "data": { "text/markdown": [ "```\n", - "bundled_groups = [HyperSparse(1), Coord(1, expanded=True), Sparse(1), Coord(1)]\n", + "bundled_groups = [HyperSparse(1), Coord(1, expanded=1), Sparse(1), Coord(1)]\n", "\n", "tim_structure = N/A\n", "\n", @@ -8147,7 +8147,7 @@ "source": [ "# voilĂ !\n", "\n", - "_Note that `Coord(n, expanded=True)`, which comes from `S-C` combination, is a silly data structure that duplicates data unnecessarily.\n", + "_Note that `Coord(n, expanded=1)`, which comes from `S-C` combination, is a silly data structure that duplicates data unnecessarily.\n", "`Coord(n)` is strongly preferred._" ] } diff --git a/sparsetensorviz/sparsetensorviz/_bundle.py b/sparsetensorviz/sparsetensorviz/_bundle.py index b450a39..dc1ffd3 100644 --- a/sparsetensorviz/sparsetensorviz/_bundle.py +++ b/sparsetensorviz/sparsetensorviz/_bundle.py @@ -71,7 +71,7 @@ class CoordSparseExpanded(MatcherBase): def __new__(cls, ma, s): numS = num(ma, "S") numC = num(ma, "C") - return [f"Coord({numS}, expanded=True)", f"Sparse({numC})"] + return [f"Coord({numS}, expanded=1)", f"Sparse({numC})"] class HyperSparse(MatcherBase):