Basic lpp usage

Submitted by jrpb on Thu, 07/12/2012 - 07:01

I'm trying to load/view a liggghts log file using lpp. I'm using:

Pizza.py (LPP 1.0 based on pizza - 7 Oct 2011), a toolkit written in Python

Following the documentation included in the tarball, I type the following from within python:

lg = log("log.liggghts")

And this is the error I get:

325 for line in lines:
326 words = line.split()
--> 327 self.data.append(map(float,words))
328
329 # print last timestep of chunk
ValueError: invalid literal for float(): WARNING:

I'm trying to extract thermodynamic info from the log. I'm using ligghts 1.5.3

Side note: an empty log file (wiped out by hand) returns a "log file has no values" as expected.

Thanks in advance for any help.

ckloss's picture

ckloss | Thu, 07/12/2012 - 15:05

Could be that src/log.py needs some update... Unfortunately, I currently do not have the time resources to look into this.

Christoph

jrpb | Sat, 07/14/2012 - 01:34

The problem was caused by intermingled thermodynamic dump lines and warnings. Example:


Step Atoms KinEng 1 Volume
0 0 -0 0 625
WARNING: Less insertions than requested
INFO: Maxmimum number of particle-tri neighbors >10 at step 1, growing array...done!
WARNING: Dangerous build in triangle neighbor list.
WARNING: Dangerous build in triangle neighbor list.
1 369 2512.3031 0.02510145 625

I modified the read_one() proc to disregard lines beginning with non-numeric chars. Unfortunately, my liggghts experience is very limited so I wouldn't know if this is the only update needed to make log.py fully compatible with a recent version of liggghts. Anyway, here's the fix:

In log.py, read_one() procedure, on line 327 add the following conditional:


if words[0][0].isalpha() == False: self.data.append(map(float,words))

Works fine with my warning-riddled excuse for a simulation's log.