[ase-users] Appending Ulm-file does not work

Jens Jørgen Mortensen jjmo at dtu.dk
Thu Mar 1 09:01:21 CET 2018


On 02/28/2018 04:48 PM, Simon Lamowski via ase-users wrote:
> Hello all!
>
> I was testing to append an ulm-file and found that it did not work.
> Hence I attached a minimal example.
>
> Since I do not understand why it is not working, I hope that someone,
> who is more familiar with the code can fix it.
>
> By the way, the add_array and fill is working, if the file is not closed
> and reopened.
>
> Here are the versions, I use:
> numpy: 1.14.0
> scipy: 1.0.0
> ase: 3.15.0
> python: 3.4.6
>
> It fails as well for versions:
> scipy: 0.19.1
> ase: 3.13.0-python34
> numpy: 1.13.2
>
> If you now a workaround, please answer.

When you first write to an ulm file, you write to the block with 
index=0.  When you open it in append mode and write some more things, 
that will go to the next block with index=1.

You can look inside an ulm file with:

[jensj at jordan ~]$ ase ulm test.ulm
test.ulm  (tag: "", 2 items)
item #0:
{
     smalllist: [1 1]}
item #1:
{
     bigarray: <ndarray shape=(4, 3) dtype=float64>}

If you change your example to "reader = ulm.Reader('test.ulm', index=1)" 
and comment out the "print(dct['smalllist'])" line, then it should work.

Jens Jørgen

>
>
> Best regards
>
> Simon Lamowski
>
>
>
> _______________________________________________
> ase-users mailing list
> ase-users at listserv.fysik.dtu.dk
> https://listserv.fysik.dtu.dk/mailman/listinfo/ase-users



More information about the ase-users mailing list