Godtone
Joined 17 December 2020
m →My Python 3 code: correction 2 |
m →My Python 3 code: correction 3 and addition |
||
| Line 611: | Line 611: | ||
# if you want more its easier to specify the val yourself plus note that | # if you want more its easier to specify the val yourself plus note that | ||
# combined with wart_tendency you can sort of specify up to 2 warts per gen | # combined with wart_tendency you can sort of specify up to 2 warts per gen | ||
def make_val(et2 | def make_val(gens, et2, warts = [], wart_tendency = 0): | ||
val = [] | val = [] | ||
if type(warts)==str: | if type(warts)==str: | ||
| Line 640: | Line 640: | ||
ivs |= set([ iv(i[1]*2,i[0]) for i in ivs ]) | ivs |= set([ iv(i[1]*2,i[0]) for i in ivs ]) | ||
return ivs | return ivs | ||
def in_subgroup(x, sg): | |||
if x[0]!=x[1]: | |||
return len( fact(unfact(x),sg) if type(x)==list else fact(x,sg) )==len(sg) | |||
else: # 1/1 is in all subgroups | |||
return True | |||
# how to make a list of inconsistently-mapped intervals from ivs | # how to make a list of inconsistently-mapped intervals from ivs | ||
# according to a val map v where "inconsistent" is usually defined as | # according to a val map v where "inconsistent" is usually defined as | ||
# over 1/2 a step of error but is customisable: | # over 1/2 a step of error but is customisable: | ||
# mapping = make_val(ed(80),'k') # 41-limit val 80k aka with 31/16 mapped sharp | # mapping = make_val(prime_limit(41), ed(80),'k') # 41-limit val 80k aka with 31/16 mapped sharp | ||
# ic = [r for r in odd_limit(45,[43],complements=False) if abs(iv_map_err(r,mapping))>=1/2] | # ic = [r for r in odd_limit(45,[43],complements=False) if abs(iv_map_err(r,mapping))>=1/2] | ||
# (ic now has all the intervals in the no-43's 45-odd-limit mapped with 80k) | # (ic now has all the intervals in the no-43's 45-odd-limit mapped with 80k) | ||
</syntaxhighlight> | </syntaxhighlight> | ||