[gpaw-users] calc.write error, bug?

Dr M C Nelson drmcnelson at gmail.com
Fri Jul 19 01:32:07 CEST 2019


I found a solution, perhaps.

The sequence  calc = GPAW,  atoms.set_calculator(calc),  calc.write( 
filespec ),  fails.

But,  after invoking  atoms.get_potential_energy(),  the call to 
calc.write(filespec),  succeeds.

So, I might conjecture that there is a link from calc to atoms, that is 
set up by atoms.get_potential_energy(),  but not by atoms.set_calculator()

As a novice user, that seems surprising.



On 7/18/19 6:09 PM, Ask Hjorth Larsen wrote:
> Dear Nelson,
>
> Am Do., 18. Juli 2019 um 22:53 Uhr schrieb Dr M C Nelson via
> gpaw-users <gpaw-users at listserv.fysik.dtu.dk>:
>> The following code excerpt
>>
>> calc = GPAW()
>>
>> atoms.set_calculator( calc )
>>
>> ....
>>
>> calc.write(  filespec.gpw, 'all' )
>>
>>
>> produces the following error:
>>
>> Traceback (most recent call last):
>>    File "./ReadCIF.py", line 693, in <module>
>>      calc.write( args.savegpaw, 'all' )
>>    File "/usr/lib64/python3.7/site-packages/gpaw/calculator.py", line 162, in write
>>      self._write(writer, mode)
>>    File "/usr/lib64/python3.7/site-packages/gpaw/calculator.py", line 171, in _write
>>      write_atoms(writer.child('atoms'), self.atoms)
>>    File "/usr/lib/python3.7/site-packages/ase/io/trajectory.py", line 326, in write_atoms
>>      b.write(pbc=atoms.pbc.tolist(),
>> AttributeError: 'NoneType' object has no attribute 'pbc'
> Please provide the full script.
>
> Best regards
> Ask
>
>>
>>
>> _______________________________________________
>> gpaw-users mailing list
>> gpaw-users at listserv.fysik.dtu.dk
>> https://listserv.fysik.dtu.dk/mailman/listinfo/gpaw-users



More information about the gpaw-users mailing list