QuantumATK Forum
QuantumATK => General Questions and Answers => Topic started by: ams_nanolab on July 21, 2017, 13:10
-
While using the script 'IV-n-log.py' as in http://docs.quantumwise.com/casestudies/ag_si_interface/ag_si_interface.html with version 2016.4, I am getting the following error
Traceback (most recent call last):
File "2.py", line 34, in <module>
config = nlread(filename,DeviceConfiguration)[1]
IndexError: list index out of range
What should I do?
-
This is a Python index error. Easy to Google. You are trying to retrieve the contents of index "1" in the list of DeviceConfigurations, but there is no item with index "1", so the error is raised. Try reading index "0" instead. If that also fails, the list is empty, meaning that there are no DeviceConfiguration objects saved in the data file that you read.
-
Okay. Good. But does the index follow the gID number? or independent?
-
If you want to retrieve a specific ID, use the object_id keyword. But nlread is designed to always return a list, thus you must anyway use [0]
c = nlread("file.nc", BulkConfiguration, object_id="gID005")[0]