Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - eastnobil

Pages: 1 [2]
16
Thanks for your helps. The error have been  resolved already. Beyond my imagination, the error comes from the Clerical error of VNL2010.02 tutorial. And the key error is the "[1]" . It should be changed to "
  • " if the nc file has only one result of transmissionspectrum. And the numbers in square brackets is respond to the transmissionspectrum in the nc file.

17
Probably your problem can be solved by changing the script as follows:
before)
transmission_spectrum = nlread("LiH2.nc",Transmission Spectrum)
after)
transmission_spectrum = nlread("LiH2.nc",TransmissionSpectrum)[0]


Please note that an index starts from not "1" but "0" in Python.
I guess there is only one Transmission data in your "LiH2.nc" and that's why you got the error message "IndexError: list index out of range" in the first calculation.

Thank you for your reply. According to your suggestion I modified the script from"[1]" to "
  • ". the error still exist as following:

+ -------------------------------------------------------------
| NanoLanguageScript execution started
+ -------------------------------------------------------------
  File "c:\docume~1\admini~1\locals~1\temp\0927007110504342.py", line 4
    transmission_spectrum = nlread("LiH2.nc",Transmission Spectrum)[0]
                                                                 ^
SyntaxError: invalid syntax
NanoLanguageScript execution failure
+ -------------------------------------------------------------
| NanoLanguageScript execution finished
+ -------------------------------------------------------------

the script of "current.py" is copied from VNL2010.02 tutorial. In addition, I normally don't think such a  simple error exist in a tutorial of famous software,like VNL. I am confused still for a error in such simple script.

18

#read the transmission spectrum
transmission_spectrum = nlread("LiH2.nc",TransmissionSpectrum)[1]
Update the above with the following:
transmission_spectrum = nlread("LiH2.nc",TransmissionSpectrum)

I have tried the script changing following the suggestion above,but I fail still. This time the error as following:
+ -------------------------------------------------------------
| NanoLanguageScript execution started
+ -------------------------------------------------------------
  File "c:\docume~1\admini~1\locals~1\temp\4346177520497036.py", line 4
    transmission_spectrum = nlread("LiH2.nc",Transmission Spectrum)
                                                                 ^
SyntaxError: invalid syntax
NanoLanguageScript execution failure
+ -------------------------------------------------------------
| NanoLanguageScript execution finished

19
According to the VNL2010.02 tutorial, I used the current.py after the calculating of transmission Spectrum for getting the current of LiH2 chain. The script of "current.py" is copied from tutorial as following:
from NanoLanguage import *

#read the transmission spectrum
transmission_spectrum = nlread("LiH2.nc",TransmissionSpectrum)[1]

#calculate current
current = transmission_spectrum.current()

#print results
print 'current = ', current

Dropping this script on the Job Manager produced the following error:
+ -------------------------------------------------------------
| NanoLanguageScript execution started
+ -------------------------------------------------------------
Traceback (most recent call last):
  File "c:\docume~1\admini~1\locals~1\temp\4130483409169978.py", line 4, in <module>
    transmission_spectrum = nlread("LiH2.nc",TransmissionSpectrum)[1]
IndexError: list index out of range
NanoLanguageScript execution failure
+ -------------------------------------------------------------
| NanoLanguageScript execution finished
+ -------------------------------------------------------------

Why did I fail in accordance with the operation of VNL2010.02 tutorial?

Pages: 1 [2]