bartneck / swiML

A project to formalise swimming programs using XML
MIT License
2 stars 2 forks source link

Simplification error in repetition #88

Closed bartneck closed 4 months ago

bartneck commented 4 months ago

In the JasiMasters2024022001.py setting the repetition simplification to true causes error.

oneSet=swiML.Repetition(
    repetitionCount=3,
    simplify=True,
    instructions=[
        oneSet1,
        oneSet2,
        oneSet3
    ]
)

results in an error:

File "/Users/cba56/Dropbox (UC Enterprise)/swimML/oxygen/swiML/jasiMasters/swiML.py", line 101, in simplify_repetition
    return f'{total_repetition*repetitionCount} x {basicInsts[0][0].length[1]}'
                                                   ~~~~~~~~~~~~~~~~~~~~~~~^^^
TypeError: 'NoneType' object is not subscriptable

When simplify is set to False, this error does not occur.

bartneck commented 4 months ago

tested and okay.