Mercurial > hg > lib > markup
comparison python/safe.py @ 13:1cd5c7952aaa default tip
fix failure to read first line of Air/Lava,
keep me from swimming in Lava, again!
author | Henry S. Thompson <ht@inf.ed.ac.uk> |
---|---|
date | Sun, 30 Jan 2022 14:49:33 -0500 |
parents | 1e42c0147a49 |
children |
comparison
equal
deleted
inserted
replaced
12:1e42c0147a49 | 13:1cd5c7952aaa |
---|---|
35 tc[k]=[y] | 35 tc[k]=[y] |
36 # convert to lists of intervals | 36 # convert to lists of intervals |
37 for k,yy in tc.items(): | 37 for k,yy in tc.items(): |
38 tyy=[yy] | 38 tyy=[yy] |
39 ii=[] | 39 ii=[] |
40 if k==(108.5, -45.5): | 40 # if k==(108.5, -45.5): WTF?? |
41 pass | 41 # pass |
42 while True: | 42 while True: |
43 clean=True | 43 clean=True |
44 for j,yy in enumerate(tyy): | 44 for j,yy in enumerate(tyy): |
45 if len(yy)==1+(yy[-1]-yy[0]): | 45 if len(yy)==1+(yy[-1]-yy[0]): |
46 ii.append((yy[0],yy[-1])) | 46 ii.append((yy[0],yy[-1])) |
54 if clean: | 54 if clean: |
55 break | 55 break |
56 self.columns[k]=set(ii) # so we can merge later | 56 self.columns[k]=set(ii) # so we can merge later |
57 | 57 |
58 def readPoints(self,file): | 58 def readPoints(self,file): |
59 file.readline() | |
60 self.points=[[float(i) for i in l.split('\t')[2].split('/')] for l in file] | 59 self.points=[[float(i) for i in l.split('\t')[2].split('/')] for l in file] |
61 | 60 |
62 Block.readHeaders=readHeaders # from util | 61 Block.readHeaders=readHeaders # from util |
63 | 62 |
64 class Air(Block): | 63 class Air(Block): |