[ase-users] Error reading cif file - out of memory.
Gaël DONVAL
gael.donval at cnrs-imn.fr
Thu Jan 24 15:01:39 CET 2013
Le jeudi 24 janvier 2013 à 13:52 +0100, Peter Bjerre Jensen a écrit :
> Dear Gaël
>
> Thank you for spotting the error - correcting as suggested works!
>
> However, I do certainly agree with you, that such a programming error
> should be fixed.
>
> I am not an expert in the cif format at all, but as I wrote this file
> was obtained from a huge database (ICSD), so I hoped that the format
> was OK (I have not been able to find the syntax specifications,
> regarding the references).
http://dx.doi.org/10.1107/S010876739101067X
http://www.iucr.org/__data/iucr/cif/standard/cifstd1.html
The definition is quite clear. However "1925 62 255 259 ZEKGAX" does not
mean anything as a CIF command and should be included IN the multi-line
string (NOT after ";" as it was given !).
The specs say that if a string is enclosed between ";", the ";" should
be the first characters of the line:
;
foo
bar
;
I did not read the specs thoroughly but, I don't know what *should*
happen if there is:
;
foo
; bar
I don't have a lot of spare time these days, but I'll try to replace
these ugly "while True"s by "for line in fileobj"s and commit a change.
Cheers
>
> But again thank you for the help.
>
> /Peter
>
> Peter Bjerre Jensen
> PhD Student
> DTU Energy Conversion
>
> Technical University of Denmark
>
>
>
> Department of Energy Conversion and
> Storage
> Fysikvej, Building 307
> 2800 Kgs. Lyngby
> Direct +45 45253204
> pbjen at dtu.dk
> www.dtu.dk
>
>
>
>
> Den 23-01-2013 12:00, ase-users-request at listserv.fysik.dtu.dk skrev:
>
> > ------------------------------
> >
> > Message: 2
> > Date: Tue, 22 Jan 2013 20:50:48 +0100
> > From: Ga?l DONVAL <gael.donval at cnrs-imn.fr>
> > Subject: Re: [ase-users] Error reading cif file - out of memory.
> > To: ase-users at listserv.fysik.dtu.dk
> > Message-ID: <1358884248.28297.22.camel at p76-nom-gd.cnrs-imn.fr>
> > Content-Type: text/plain; charset="UTF-8"
> >
> > Hi,
> >
> > Ill-formatted file l.26:
> > ; 1925 62 255 259 ZEKGAX
> > should be:
> > 1925 62 255 259 ZEKGAX
> > ;
> >
> > But I must admit that a piece of code beginning by "while True" is
> > usually not a bright idea (in cif.py l.68) :)
> >
> > Cheers,
> > Ga?l
> >
> > Le mardi 22 janvier 2013 ? 17:47 +0100, Peter Bjerre Jensen a ?crit :
> > > Hi
> > >
> > > Can anyone tell me why, reading the attached cif file is not working and
> > > uses A LOT of memory (I used ~10 GB before it was killed).
> > >
> > > The cif file is from the ICSD database.
> > >
> > > I try the following:
> > >
> > > Python 2.4.3 (#1, Jan 9 2013, 06:47:03)
> > > [GCC 4.1.2 20080704 (Red Hat 4.1.2-54)] on linux2
> > > Type "help", "copyright", "credits" or "license" for more information.
> > > >>> from ase.io import *
> > > >>> atoms = read('Zr_RT_53785.cif')
> > > Traceback (most recent call last):
> > > File "<stdin>", line 1, in ?
> > > File "/home/camp/pbjen/bin/ase_2686/ase/io/__init__.py", line 201, in
> > > read
> > > return read_cif(filename, index)
> > > File "/home/camp/pbjen/bin/ase_2686/ase/io/cif.py", line 276, in read_cif
> > > blocks = parse_cif(fileobj)
> > > File "/home/camp/pbjen/bin/ase_2686/ase/io/cif.py", line 185, in
> > > parse_cif
> > > blocks.append(parse_block(fileobj, line))
> > > File "/home/camp/pbjen/bin/ase_2686/ase/io/cif.py", line 167, in
> > > parse_block
> > > tags = parse_items(fileobj, line)
> > > File "/home/camp/pbjen/bin/ase_2686/ase/io/cif.py", line 155, in
> > > parse_items
> > > temp = parse_multiline_string(fileobj, line)
> > > File "/home/camp/pbjen/bin/ase_2686/ase/io/cif.py", line 72, in
> > > parse_multiline_string
> > > lines.append(line)
> > > MemoryError
> > > >>>
> > >
> > > /Peter
> > >
> > > PS. I think the solution for now for me will be to manually build the
> > > unit cell, by entering the parameters; but I do not think this should be
> > > necessary?
> > >
> > > _______________________________________________
> > > ase-users mailing list
> > > ase-users at listserv.fysik.dtu.dk
> > > https://listserv.fysik.dtu.dk/mailman/listinfo/ase-users
> >
>
> _______________________________________________
> ase-users mailing list
> ase-users at listserv.fysik.dtu.dk
> https://listserv.fysik.dtu.dk/mailman/listinfo/ase-users
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 4053 bytes
Desc: not available
URL: <http://listserv.fysik.dtu.dk/pipermail/ase-users/attachments/20130124/160b3d24/attachment.bin>
More information about the ase-users
mailing list