Author Topic: null calculator  (Read 4632 times)

0 Members and 1 Guest are viewing this topic.

Offline esp

  • Supreme QuantumATK Wizard
  • *****
  • Posts: 318
  • Country: us
  • Reputation: 3
    • View Profile
    • University of Minnesota
null calculator
« on: January 16, 2012, 22:22 »
I am getting an error after reading in a file ... File "C:\Users\patakye\Documents\EP_EDU\GradSchool\UMN\KiaResearch\QuantumSimulations\ATK\ATKSIMS\gnr_12_0_AGNR_z10.py", line 672, in doCalcs2     calculator(electrode_voltages=(-0.1*Volt,0.1*Volt)), TypeError: 'NoneType' object is not callable My setup is like this ... I create the device in one function and save it as:
Code
	#----------------------------------------
	# Device Calculator
	#----------------------------------------
	calculator = DeviceHuckelCalculator(
		basis_set=basis_set,
		electrode_voltages=(-0.1*Volt,0.1*Volt),
		electrode_calculators=
			[left_electrode_calculator, right_electrode_calculator],
		)

	device_configuration.setCalculator(calculator)
	nlprint(device_configuration)
	device_configuration.update()
	nlsave(outFileName, device_configuration)
then in another function:
Code
	#read in the old configuration
	device_configuration = nlread(outFileName,DeviceConfiguration)[0]
	calculator = device_configuration.calculator()
This is where I get an error that the calculator object is null ... am i doing this incorrectly?

Offline esp

  • Supreme QuantumATK Wizard
  • *****
  • Posts: 318
  • Country: us
  • Reputation: 3
    • View Profile
    • University of Minnesota
Re: null calculator
« Reply #1 on: January 16, 2012, 22:35 »
I think I figured this one out .. i saved multiple times and there were multiple device configurations in the file .. i used the object_id when saving and reading, and it works now. 

Offline Nordland

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 812
  • Reputation: 18
    • View Profile
Re: null calculator
« Reply #2 on: January 16, 2012, 22:41 »
You bet me to it.

When I had enter my answer it said newer post since last edit.

Good you found out.