From 77bbc712141193e2fa990418837b36da2c5b20aa Mon Sep 17 00:00:00 2001 From: Jonathan Harker Date: Mon, 23 Sep 2024 11:32:34 +1200 Subject: [PATCH] Fix Leonard notation to use superscript parentheses for brightness --- setclass/setclass.py | 2 +- setclass/tests/test_setclass.py | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/setclass/setclass.py b/setclass/setclass.py index 746bdb3..61fd3a1 100644 --- a/setclass/setclass.py +++ b/setclass/setclass.py @@ -167,7 +167,7 @@ class SetClass(list): sub = subscript(self.adjacency_intervals[i]) pitches += f"{pitch}{sub}" sup = superscript(self.brightness) - return f"[{pitches}]{sup}" + return f"[{pitches}]⁽{sup}⁾" # Class methods ----------------------------------------------------------- diff --git a/setclass/tests/test_setclass.py b/setclass/tests/test_setclass.py index e3d5452..fd1b75d 100644 --- a/setclass/tests/test_setclass.py +++ b/setclass/tests/test_setclass.py @@ -72,18 +72,18 @@ def test_brightest_form(): b = f520.brightest_form assert b in f520.versions assert b == SetClass(0, 4, 5, 9, 10) - assert b.leonard_notation == '[0₄4₁5₄9₁10₂]²⁸' + assert b.leonard_notation == '[0₄4₁5₄9₁10₂]⁽²⁸⁾' def test_darkest_form(): d = f520.darkest_form assert d in f520.versions assert d == SetClass(0, 1, 3, 7, 8) - assert d.leonard_notation == '[0₁1₂3₄7₁8₄]¹⁹' + assert d.leonard_notation == '[0₁1₂3₄7₁8₄]⁽¹⁹⁾' def test_leonard_notation(): - assert f520.leonard_notation == '[0₁1₄5₁6₂8₄]²⁰' + assert f520.leonard_notation == '[0₁1₄5₁6₂8₄]⁽²⁰⁾' # ---------------------------------------------------------------------------- @@ -122,18 +122,18 @@ def test_complement_brightest_form(): b = f520.complement.brightest_form assert b in f520.complement.versions assert b == SetClass(0, 3, 5, 6, 7, 10, 11) - assert b.leonard_notation == '[0₃3₂5₁6₁7₃10₁11₁]⁴²' + assert b.leonard_notation == '[0₃3₂5₁6₁7₃10₁11₁]⁽⁴²⁾' def test_complement_darkest_form(): d = f520.complement.darkest_form assert d in f520.complement.versions assert d == SetClass(0, 1, 2, 5, 6, 7, 10) - assert d.leonard_notation == '[0₁1₁2₃5₁6₁7₃10₂]³¹' + assert d.leonard_notation == '[0₁1₁2₃5₁6₁7₃10₂]⁽³¹⁾' def test_complement_leonard_notation(): - assert f520.complement.leonard_notation == '[0₁1₁2₃5₂7₁8₁9₃]³²' + assert f520.complement.leonard_notation == '[0₁1₁2₃5₂7₁8₁9₃]⁽³²⁾' # ---------------------------------------------------------------------------- @@ -188,7 +188,7 @@ def test_empty_dozenal_notation(): def test_empty_leonard_notation(): - assert empty.leonard_notation == '[]⁰' + assert empty.leonard_notation == '[]⁽⁰⁾' # ---------------------------------------------------------------------------- @@ -247,7 +247,7 @@ def test_empty_complement_dozenal_notation(): def test_empty_complement_leonard_notation(): - assert f121.leonard_notation == '[0₁1₁2₁3₁4₁5₁6₁7₁8₁9₁10₁11₁]⁶⁶' + assert f121.leonard_notation == '[0₁1₁2₁3₁4₁5₁6₁7₁8₁9₁10₁11₁]⁽⁶⁶⁾' # ----------------------------------------------------------------------------