Probe-Particle / PPSTM

Code simulating variousSTM techniques, especially for tilting tip (dependent on https://github.com/Probe-Particle/ppafm)l)
MIT License
8 stars 1 forks source link

”AssertionError: We did't find the -- Fermi -- line - meaning the end of the file” #25

Closed lycheehoo closed 1 week ago

lycheehoo commented 4 months ago

Dear developers, I use the GUI to simulate the corresponding dI/dV maps, but the error happened below. Traceback (most recent call last): File "F:\PPSTM-master\GUI.py", line 744, in imported self.importData = importData(self.myDict, self.paths) File "F:\PPSTM-master\pyPPSTM\guiMethods.py", line 135, in importData pbc=pbc, cut_min=cut_min, cut_max=cut_max, cut_at=cut_atoms, lower_atoms=lower_atoms, lower_coefs=lower_coefs); File "F:\PPSTM-master\pyPPSTM\ReadSTM.py", line 537, in read_CP2K_all labels, eig, occs, evecs, fermi_energy = read_cp2k_MO_file(name+"-cartesian-mos-1_0.MOLog", spin=spin) File "F:\PPSTM-master\pyPPSTM\ReadSTM.py", line 612, in read_cp2k_MO_file assert parts != None, "We did't find the -- Fermi -- line - meaning the end of the file" AssertionError: We did't find the -- Fermi -- line - meaning the end of the file The corresponding name+"-cartesian-mos-1_0.MOLog file is in the attachment. Could you please tell me how to solve this problem? Thanks! TPBi-cartesian-mos-1_0.zip

ondrejkrejci commented 4 months ago

Hi,

it seems to me, that the zip is empty. Please could you attach it once more and also the CP2K input file? Generally it sounds to me, like the MOLog file is either corrupted, or created with a different version of CP2K. Thank you! Regards, Ondrej

From: lycheehoo @.> Sent: Thursday, May 9, 2024 4:00 PM To: Probe-Particle/PPSTM @.> Cc: Subscribed @.***> Subject: [Probe-Particle/PPSTM] ”AssertionError: We did't find the -- Fermi -- line - meaning the end of the file” (Issue #25)

Dear developers, I use the GUI to simulate the corresponding dI/dV maps, but the error happened below. Traceback (most recent call last): File "F:\PPSTM-master\GUI.py", line 744, in imported self.importData = importData(self.myDict, self.paths) File "F:\PPSTM-master\pyPPSTM\guiMethods.py", line 135, in importData pbc=pbc, cut_min=cut_min, cut_max=cut_max, cut_at=cut_atoms, lower_atoms=lower_atoms, lower_coefs=lower_coefs); File "F:\PPSTM-master\pyPPSTM\ReadSTM.py", line 537, in read_CP2K_all labels, eig, occs, evecs, fermi_energy = read_cp2k_MO_file(name+"-cartesian-mos-1_0.MOLog", spin=spin) File "F:\PPSTM-master\pyPPSTM\ReadSTM.py", line 612, in read_cp2k_MO_file assert parts != None, "We did't find the -- Fermi -- line - meaning the end of the file" AssertionError: We did't find the -- Fermi -- line - meaning the end of the file The corresponding name+"-cartesian-mos-1_0.MOLog file is in the attachment. Could you please tell me how to solve this problem? Thanks! TPBi-cartesian-mos-1_0.ziphttps://github.com/Probe-Particle/PPSTM/files/15262584/TPBi-cartesian-mos-1_0.zip

— Reply to this email directly, view it on GitHubhttps://github.com/Probe-Particle/PPSTM/issues/25, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ADFZAFMK5KURY223TNCBY5TZBNXMBAVCNFSM6AAAAABHOY4BLGVHI2DSMVQWIX3LMV43ASLTON2WKOZSGI4DONRUG4ZTENI. You are receiving this because you are subscribed to this thread.Message ID: @.**@.>>

lycheehoo commented 4 months ago

TPBi-cartesian-mos-1_0.zip

ondrejkrejci commented 4 months ago

Hi,

I have look at it, and the easy answer is that you are once more using MOLog file created with too new version of CP2K. So short term solution is to go with older CP2K, if that is what is easier for you. But I really think that the longterm solution is to start into Python coding a little bit. The only procedure, that needs to be rewritten is this one:https://github.com/Probe-Particle/PPSTM/blob/bb6a027191958c723c639e360dbcc89d77cd933c/pyPPSTM/ReadSTM.py#L593 Where you need to add an extra If in the beginning for looking for this MO| in the beginning in the line and then basically has the same procedure, but all the indexing on each line would be +1 and also there is now E(Fermi) instead of Fermi energy - change in the Fermi level naming. I personally do not have time and personal motivation to do it, but please go forward, I can help you with adding your GitHub account to the developer's. Regards, Ondrej


From: lycheehoo @.> Sent: Friday, May 10, 2024 4:17 AM To: Probe-Particle/PPSTM @.> Cc: Krejci Ondrej @.>; Comment @.> Subject: Re: [Probe-Particle/PPSTM] ”AssertionError: We did't find the -- Fermi -- line - meaning the end of the file” (Issue #25)

TPBi-cartesian-mos-1_0.ziphttps://github.com/Probe-Particle/PPSTM/files/15269213/TPBi-cartesian-mos-1_0.zip

— Reply to this email directly, view it on GitHubhttps://github.com/Probe-Particle/PPSTM/issues/25#issuecomment-2103678634, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ADFZAFKOJHHNMJWJOMV73CDZBQNZLAVCNFSM6AAAAABHOY4BLGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMBTGY3TQNRTGQ. You are receiving this because you commented.Message ID: @.***>

lycheehoo commented 4 months ago

Okay, I got it! Thank you very much! :)

lycheehoo commented 4 months ago

Dear Ondřej Krejčí, sorry to bother you again. When I use the PPSTM_simple.py to simulate the maps, the error came below. atomic geometry read Reading CP2K MOs from:NN-cartesian-mos-1_0.MOLog Traceback (most recent call last): File "PPSTM_simple.py", line 208, in <module> eigEn1, coefs1, Ratin = RS.read_CP2K_all(name = files_path + cp2k_name , lvs=cell, fermi=fermi, orbs = sample_orbs, pbc=pbc, cut_min=cut_min, cut_max=cut_max, cut_at=cut_atoms, lower_atoms=lower_atoms, lower_coefs=lower_coefs, spin='alpha'); File "/public3/home/sc53074/anaconda3/lib/python3.7/site-packages/pyPPSTM/ReadSTM.py", line 537, in read_CP2K_all labels, eig, occs, evecs, fermi_energy = read_cp2k_MO_file(name+"-cartesian-mos-1_0.MOLog", spin=spin) File "/public3/home/sc53074/anaconda3/lib/python3.7/site-packages/pyPPSTM/ReadSTM.py", line 599, in read_cp2k_MO_file evecs = [list() for i in range(nbasis)] NameError: name 'nbasis' is not defined I do not change the code in ReadSTM.py, could you please tell me the reason for this problem? Thanks again.

ondrejkrejci commented 3 months ago

This is very strange, Please could you try to download the latest version and compile it once more? The error seems to be in ReadSTM.py file, but that is really stable over last 4 years, while now the same line is on line 650: https://github.com/Probe-Particle/PPSTM/blob/bb6a027191958c723c639e360dbcc89d77cd933c/pyPPSTM/ReadSTM.py#L650 ; While your error says: line 599, in read_cp2k_MO_file evecs = [list() for i in range(nbasis)]; This sounds to me, like large part of the ReadSTM.py file was corrupted somehow. The download and compilation seems to be the easiest way to overcome this problem.

From: lycheehoo @.> Sent: Saturday, May 11, 2024 5:44 AM To: Probe-Particle/PPSTM @.> Cc: Krejci Ondrej @.>; Comment @.> Subject: Re: [Probe-Particle/PPSTM] ”AssertionError: We did't find the -- Fermi -- line - meaning the end of the file” (Issue #25)

Dear Ondřej Krejčí, sorry to bother you again. When I use the PPSTM_simple.py to simulate the maps, the error came below. atomic geometry read Reading CP2K MOs from:NN-cartesian-mos-1_0.MOLog Traceback (most recent call last): File "PPSTM_simple.py", line 208, in eigEn1, coefs1, Ratin = RS.read_CP2K_all(name = files_path + cp2k_name , lvs=cell, fermi=fermi, orbs = sample_orbs, pbc=pbc, cut_min=cut_min, cut_max=cut_max, cut_at=cut_atoms, lower_atoms=lower_atoms, lower_coefs=lower_coefs, spin='alpha'); File "/public3/home/sc53074/anaconda3/lib/python3.7/site-packages/pyPPSTM/ReadSTM.py", line 537, in read_CP2K_all labels, eig, occs, evecs, fermi_energy = read_cp2k_MO_file(name+"-cartesian-mos-1_0.MOLog", spin=spin) File "/public3/home/sc53074/anaconda3/lib/python3.7/site-packages/pyPPSTM/ReadSTM.py", line 599, in read_cp2k_MO_file evecs = [list() for i in range(nbasis)] NameError: name 'nbasis' is not defined I do not change the code in ReadSTM.py, could you please tell me the reason for this problem? Thanks again.

— Reply to this email directly, view it on GitHubhttps://github.com/Probe-Particle/PPSTM/issues/25#issuecomment-2105494351, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ADFZAFKLUX3YT5TSTWXGXDTZBWAX5AVCNFSM6AAAAABHOY4BLGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMBVGQ4TIMZVGE. You are receiving this because you commented.Message ID: @.**@.>>