Skip to content

Commit

Permalink
Unify precision
Browse files Browse the repository at this point in the history
 - Tunings are now unified to three decimal places, following the wiki and other apps
  • Loading branch information
FloraCanou committed Dec 7, 2024
1 parent f26c759 commit 5404ce4
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 13 deletions.
5 changes: 3 additions & 2 deletions te_common.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# © 2020-2024 Flora Canou | Version 1.6.0
# © 2020-2024 Flora Canou | Version 1.6.2
# This work is licensed under the GNU General Public License version 3.

import re, functools, itertools, warnings
import re, functools, itertools, warnings
import numpy as np
from scipy import linalg
from sympy.matrices import Matrix, normalforms
from sympy import gcd
np.set_printoptions (suppress = True, linewidth = 256, precision = 3)

PRIME_LIST = [
2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37,
Expand Down
5 changes: 2 additions & 3 deletions te_lattice.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
# © 2020-2023 Flora Canou | Version 1.1.0
# © 2020-2023 Flora Canou | Version 1.6.2
# This work is licensed under the GNU General Public License version 3.

import math, warnings
import numpy as np
from scipy import linalg
import te_common as te
import te_temperament_measures as te_tm
np.set_printoptions (suppress = True, linewidth = 256)

class TemperamentLattice (te_tm.Temperament):
def find_temperamental_norm (self, monzo, norm = te.Norm (), oe = False, show = True):
Expand All @@ -33,7 +32,7 @@ def find_complexity_spectrum (self, monzos, norm = te.Norm (), oe = True):
print ("\nComplexity spectrum: ")
for entry in spectrum:
ratio = te.monzo2ratio (entry[0], self.subgroup)
print (f"{ratio}\t{entry[1]:.4f}")
print (f"{ratio}\t{entry[1]:.3f}")

find_spectrum = find_complexity_spectrum

Expand Down
3 changes: 1 addition & 2 deletions te_optimizer.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
# © 2020-2023 Flora Canou | Version 1.2.0
# © 2020-2023 Flora Canou | Version 1.6.2
# This work is licensed under the GNU General Public License version 3.

import warnings
import numpy as np
from scipy import optimize, linalg
from sympy.matrices import Matrix, normalforms
import te_common as te
np.set_printoptions (suppress = True, linewidth = 256, precision = 4)

def wrapper_main (breeds, subgroup = None, norm = te.Norm (), inharmonic = False,
constraint = None, destretch = None, show = True):
Expand Down
4 changes: 2 additions & 2 deletions te_optimizer_legacy.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# © 2020-2023 Flora Canou | Version 0.27.2
# © 2020-2024 Flora Canou | Version 0.27.3
# This work is licensed under the GNU General Public License version 3.

import warnings
import numpy as np
from scipy import optimize, linalg
np.set_printoptions (suppress = True, linewidth = 256, precision = 4)
np.set_printoptions (suppress = True, linewidth = 256, precision = 3)

PRIME_LIST = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89]

Expand Down
3 changes: 1 addition & 2 deletions te_symbolic.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# © 2020-2024 Flora Canou | Version 1.6.1
# © 2020-2024 Flora Canou | Version 1.6.2
# This work is licensed under the GNU General Public License version 3.

import warnings
Expand All @@ -7,7 +7,6 @@
from sympy.matrices import Matrix, BlockMatrix
from sympy import Rational, floor, log, Pow, pprint, simplify
import te_common as te
np.set_printoptions (suppress = True, linewidth = 256, precision = 4)

class NormSym (te.Norm):
"""Specialized norm class for symbolic calculations."""
Expand Down
3 changes: 1 addition & 2 deletions te_temperament_measures.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# © 2020-2024 Flora Canou | Version 1.5.1
# © 2020-2024 Flora Canou | Version 1.6.2
# This work is licensed under the GNU General Public License version 3.

import itertools, re, warnings
Expand All @@ -7,7 +7,6 @@
from sympy.matrices import Matrix, BlockMatrix
from sympy import gcd
import te_common as te
np.set_printoptions (suppress = True, linewidth = 256, precision = 4)

class Temperament:
def __init__ (self, breeds, subgroup = None, saturate = True, normalize = True): #NOTE: "map" is a reserved word
Expand Down

0 comments on commit 5404ce4

Please sign in to comment.