Godtone (talk | contribs)
My Python 3 code: fixed subgroup-related things and corrected a variable name
Godtone (talk | contribs)
My Python 3 code: added code for checking odd-limit consistency
Line 561: Line 561:
def consistent_err(x, et2, p=None):
def consistent_err(x, et2, p=None):
return pval(x if type(x)==list else fact(x,p), et2, p) - steps(as_float(x,p),et2)
return pval(x if type(x)==list else fact(x,p), et2, p) - steps(as_float(x,p),et2)
def odd_lim(lim, remove=set(), add=set()):
odds = set([i for i in range(1,lim+1,2) if i not in remove])
odds |= set(add)
ivs = set()
for numer in odds:
for denom in odds:
if numer > denom:
oct_denom = denom
while oct_denom*2 < numer:
oct_denom *= 2
ivs|={iv(numer,oct_denom)}
return ivs
def inconsistencies(ivs, et2, threshold=1/2):
return [r for r in ivs if abs( consistent_err(fact(r),et2) )>=threshold]
</syntaxhighlight>
</syntaxhighlight>