コード例 #1
0
def test_badCFIsS3Sat(s3BadCF):
    foundry = Foundry(Optimize())
    foundry.applySpec(s3BadCF)
    assert foundry.check() == sat
コード例 #2
0
def foundry():
    return Foundry(Optimize())
コード例 #3
0
def test_repairS2WorksFromGoodCF(foundry, goodCF, s2GoodCF, s2MaxCounts, highSpeciesGamut):
    badSpecs = getAllBadSpecs(s2GoodCF, s2MaxCounts)
    for badSpec in badSpecs:
        foundry = Foundry(Optimize()).applySpec(badSpec)
        s2GoodCF = foundry.extractPitches(badSpec.line)
        assert checkS2(goodCF, repairS2(goodCF, s2GoodCF, highSpeciesGamut)).isValid() == True
コード例 #4
0
def workingCF(cantus):
    f = Foundry(Optimize())
    f.applySpec(cantus)
    return f.extractPitches(cantus.line)
コード例 #5
0
def test_goodCFIsS2Sat(s2GoodCF):
    foundry = Foundry(Optimize())
    foundry.applySpec(s2GoodCF)
    assert foundry.check() == sat
コード例 #6
0
def test_repairS1WorksFromBadCF(foundry, badCF, s1BadCF, maxCount, highSpeciesGamut):
    badSpecs = getAllBadSpecs(s1BadCF, maxCount)
    for badSpec in badSpecs:
        foundry = Foundry(Optimize()).applySpec(badSpec)
        s1BadCF = foundry.extractPitches(badSpec.line)
        assert checkS1(badCF, repairS1(badCF, s1BadCF, highSpeciesGamut)).isValid() == True
コード例 #7
0
def test_repairCFWorksOnBrokenCF(foundry, cantus, maxCount, cantusGamut):
    badSpecs = getAllBadSpecs(cantus, maxCount)
    for badSpec in badSpecs:
        foundry = Foundry(Optimize()).applySpec(badSpec)
        cantus = foundry.extractPitches(badSpec.line)
        assert checkCF(repairCF(cantus, cantusGamut)).isValid()