SModelS / smodels

SModelS
https://smodels.github.io
14 stars 4 forks source link

Importing QNUMBERS Bug in particlesLoader.py when QNUMBERS are the first block #33

Open mdgoodsell opened 1 year ago

mdgoodsell commented 1 year ago

In line 53 of particlesLoader.py the blocks are split by:

blocks = [b.splitlines() for b in data.split('\nblock')]

If BLOCK QNUMBERS appears as the first block then the code fails to read it because

headerInfo = [x for x in b[0].replace('qnumbers','').split() if x != '#']

returns block for b[0] for the first one instead of the pdg. I then get the error local variable 'pdg' referenced before assignment

Presumably this can be fixed by doing

blocks = [b.replace('block','').splitlines() for b in data.split('\nblock')]

instead

WolfgangWaltenberger commented 1 year ago

Thanks, Mark, fixed in 20bb2ff72f2c67eccb33f91a080d06dfb01279ec (develop branch for now)