Index Error using

2 views
Skip to first unread message

Gabriel Alves de Jong

unread,
Aug 30, 2025, 3:00:18 AM (11 days ago) Aug 30
to g_mmpbsa Mailing List
Dear g_mmpbsa user community,

I am getting an index error in the last step of my calculation using the g_mmpbsa Python package. When I run the following command:

g_mmpbsa average -m energy_MM.xvg -p polar.xvg -a apolar.xvg -bs

I encounter the error shown below.

I have also tried using the deprecated MmPbSaStat.py, but the same error occurred. ChatGPT suggested that the issue might be related to the apolar.xvg file. According to the documentation, it should contain 10 columns, whereas my file only has 7.

Any help or suggestions on how to resolve this problem would be greatly appreciated.

Thanks in advance!

Best regards,
Gabriel De Jong - MSc USP Brazil

Traceback (most recent call last):
  File "/home/tomich/miniforge3/lib/python3.12/site-packages/g_mmpbsa/average.py", line 287, in ReadData
    value = float(data[i][j])
                  ~~~~~~~^^^
IndexError: index 7 is out of bounds for axis 0 with size 7

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/tomich/miniforge3/bin/g_mmpbsa", line 8, in <module>
    sys.exit(main.main())
             ^^^^^^^^^^^
  File "/home/tomich/miniforge3/lib/python3.12/site-packages/g_mmpbsa/main.py", line 78, in main
    average.main()
  File "/home/tomich/miniforge3/lib/python3.12/site-packages/g_mmpbsa/average.py", line 66, in main
    cTmp.CalcEnergy(args,frame_wise,0)
  File "/home/tomich/miniforge3/lib/python3.12/site-packages/g_mmpbsa/average.py", line 87, in CalcEnergy
    apolEn = ReadData(self.APolFile,n=10)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomich/miniforge3/lib/python3.12/site-packages/g_mmpbsa/average.py", line 289, in ReadData
    raise FloatingPointError('\nCould not convert {0} to floating point number.. Something is wrong in {1}..\n' .format(data[i][j], FileName))
                                                                                                                        ~~~~~~~^^^
IndexError: index 7 is out of bounds for axis 0 with size 7





Rajendra Kumar

unread,
Aug 30, 2025, 3:04:31 AM (11 days ago) Aug 30
to g_mm...@googlegroups.com
Hi,

Thanks for reporting the issue. I will fix the issue as soon as possible. Now there are only 7 columns in apolar.xvg.

Thanks!

--
You received this message because you are subscribed to the Google Groups "g_mmpbsa Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to g_mmpbsa+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/g_mmpbsa/939b2228-a6fc-4e85-afd3-415110a759f9n%40googlegroups.com.

Rajendra Kumar

unread,
Sep 1, 2025, 6:49:19 AM (8 days ago) Sep 1
to g_mmpbsa Mailing List
I have fixed the error. Please update the package and it should fix the error.

Thanks!

Reply all
Reply to author
Forward
0 new messages