以下の内容はhttps://ytyaru.hatenablog.com/entry/2018/12/04/000000より取得しました。


Scaleクラス修正に伴い純正律クラスの修正をした

D Major Scaleの構成音はD, E, F#, G, A, B, C#

成果物

GitHubPython.MusicTheory.JustIntonation.Scale.201709241330

前回まで

今回

Scaleクラス修正に伴い純正律クラスの修正をした。

JustIntonation.pyにてScale.KeyでなくScale.Key.PitchClassを参照するようにした。

以下のテストでScale, ScaleKeyクラスの循環参照に気づいたため弱参照にして解決した。

./src/TestJustIntonation.py

======================================================================
FAIL: test_init_set (__main__.TestJustIntonation)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "TestJustIntonation.py", line 55, in test_init_set
    print(j.Scale)
AssertionError: ReferenceError not raised

./src/MusicTheory/scale/ScaleKey.py

self.__scale = weakref.proxy(scale)
#self.__scale = scale
テストコード 項目数
TestJustIntonation.py 7
TestScale.py, TestScaleKey.py 14

テスト計165項目。

所感

ほかにも不備があるかもしれない。少し見直してみよう。




以上の内容はhttps://ytyaru.hatenablog.com/entry/2018/12/04/000000より取得しました。
このページはhttp://font.textar.tv/のウェブフォントを使用してます

不具合報告/要望等はこちらへお願いします。
モバイルやる夫Viewer Ver0.14