Module:Infobox ET: Difference between revisions
Undo revision 184876 by ArrowHead294 (talk). The debug mode is used in several places on the wiki where categories should be disabled Tag: Undo |
Prevent timeout by adopting a lower limit for non-octave equal tunings |
||
| Line 29: | Line 29: | ||
local converges = rat.converges(ratio, math.log(interval) / math.log(rat.as_float(et.equave))) | local converges = rat.converges(ratio, math.log(interval) / math.log(rat.as_float(et.equave))) | ||
if et.size > 1 and converges then | if et.size > 1 and converges then | ||
convergement_notice = "<br | convergement_notice = "<br>(" .. converges .. ")" | ||
end | end | ||
| Line 182: | Line 182: | ||
end | end | ||
-- consistency and distinct consistency | |||
-- max_limit is used to prevent timeout | |||
local consistency = tonumber(frame.args["Consistency"]) | local consistency = tonumber(frame.args["Consistency"]) | ||
local max_limit = rat.eq(et.equave, 2) and 43 or 32 | |||
if consistency == nil then | if consistency == nil then | ||
consistency = limits.consistency_limit(et, false, | consistency = limits.consistency_limit(et, false, max_limit) | ||
end | end | ||
if consistency == nil then | if consistency == nil then | ||
consistency = "at least | consistency = "at least " .. max_limit | ||
end | end | ||
if consistency ~= nil then | if consistency ~= nil then | ||
| Line 197: | Line 200: | ||
local distinct_consistency = tonumber(frame.args["Distinct consistency"]) | local distinct_consistency = tonumber(frame.args["Distinct consistency"]) | ||
if distinct_consistency == nil then | if distinct_consistency == nil then | ||
distinct_consistency = limits.consistency_limit(et, consistency or true, | distinct_consistency = limits.consistency_limit(et, consistency or true, max_limit) | ||
end | end | ||
if distinct_consistency == nil then | if distinct_consistency == nil then | ||
distinct_consistency = "at least | distinct_consistency = "at least " .. max_limit | ||
end | end | ||
if distinct_consistency ~= nil then | if distinct_consistency ~= nil then | ||
| Line 223: | Line 226: | ||
if zeta_switch then | if zeta_switch then | ||
if #text > 0 then | if #text > 0 then | ||
text = text .. "<br | text = text .. "<br>" | ||
end | end | ||
if not value_provided(zeta_override) then | if not value_provided(zeta_override) then | ||