Godtone (talk | contribs)
My Python 3 code: fix & better explain code & make more flexible
Godtone (talk | contribs)
Line 1,383: Line 1,383:
# this gives much sparser but also much more interesting lists.
# this gives much sparser but also much more interesting lists.
# default weighting of an interval x is proportional to its odd-limit complexity iv_complexity(x).
# default weighting of an interval x is proportional to its odd-limit complexity iv_complexity(x).
def strict_optimal_edo_sequence(ivs,up_to=311,weighting=lambda x: iv_complexity(x),combine='avg'):
def strict_optimal_edo_sequence(ivs,edo_set=range(2,311+2),weighting=lambda x: iv_complexity(x),combine='avg'):
return optimal_edo_sequence(lambda edo: et_badness(ivs,edo,lambda rel_err,x,et2: rel_err**2,weighting,combine),up_to)
return optimal_edo_sequence(lambda edo: et_badness(ivs,edo,lambda rel_err,x,et2: rel_err**2,weighting,combine),edo_set)
</syntaxhighlight>
</syntaxhighlight>