Lines Matching refs:x

91 def si(x, w=4):  argument
92 if x == 0:
98 p = 3*int(m.log(abs(x)*10, 10**3))
101 s = '%.*f' % (w, abs(x) / (10.0**p))
105 s = s[:max(s.find('.'), w-(2 if x < 0 else 1))]
108 return '%s%s%s' % ('-' if x < 0 else '', s, SI_PREFIXES[p])
110 def si2(x, w=5): argument
111 if x == 0:
117 p = 10*int(m.log(abs(x)*10, 2**10))
120 s = '%.*f' % (w, abs(x) / (2.0**p))
124 s = s[:max(s.find('.'), w-(3 if x < 0 else 2))]
127 return '%s%s%s' % ('-' if x < 0 else '', s, SI2_PREFIXES[p])
238 def dat(x): argument
240 if '/' in x:
241 x, _ = x.split('/', 1)
245 return int(x, 0)
251 return float(x)
253 if m.isinf(x) or m.isnan(x):
254 raise ValueError("invalid dat %r" % x)
259 raise ValueError("invalid dat %r" % x)
263 def symlog(x): argument
264 if x > 1:
265 return m.log(x)+1
266 elif x < -1:
267 return -m.log(-x)-1
269 return x
294 def scale(self, x, y): argument
298 x = int(self.width * (
299 (symlog(x)-symlog(self.xlim[0]))
302 x = int(self.width * (
303 (x-self.xlim[0])
314 x = 0
316 return x, y
318 def point(self, x, y, *, argument
322 x, y = self.scale(x, y)
325 if x >= 0 and x < self.width and y >= 0 and y < self.height:
326 self.grid[x + y*self.width] = (color, char)
378 for x, y in coords:
380 self.point(x, y,
396 for x in range(self.width//xscale):
403 f, c = self.grid[x*xscale+(xscale-1-(i%xscale))
430 if x == 0 and y == 0:
432 elif x == 0 and y == self.height//yscale-1:
434 elif x == self.width//xscale-1 and y == 0:
436 elif x == 0:
469 def dataset(results, x=None, y=None, define=[]): argument
479 if x is not None:
480 if x not in r:
483 x_ = dat(r[x])
508 def datasets(results, by=None, x=None, y=None, define=[]): argument
539 for x_ in (x if x is not None else [None]):
542 k_x = x_ if len(x or []) > 1 else ''
558 self.x = 0
586 x, y = i
587 if x < 0:
588 x += len(self.xweights)
592 return self.map[(x,y)]
625 if s.x+s.xspan-1 == new_i:
627 elif s.x > new_i:
628 s.x += 1
643 if s.x+s.xspan-1 == new_i:
645 elif s.x > new_i:
646 s.x += 1
681 self.map = self_map | {(x, y+len(self_yweights)): s
682 for (x, y), s in other_map.items()}
690 self.map = other_map | {(x, y+len(other.yweights)): s
691 for (x, y), s in self_map.items()}
774 s.x += len(self_xweights)
779 self.map = self_map | {(x+len(self_xweights), y): s
780 for (x, y), s in other_map.items()}
783 s.x += len(other.xweights)
788 self.map = other_map | {(x+len(other.xweights), y): s
789 for (x, y), s in self_map.items()}
817 x=None, argument
887 for k, vs in it.chain(by or [], x or [], y or [])))
890 if x is not None:
891 x = [k for k, _ in x]
948 + (1 if s.x > 0 else 0), # space between
963 max(s_.xmargin[0] for s_ in grid if s_.x == s.x),
964 max(s_.xmargin[1] for s_ in grid if s_.x == s.x),
983 datasets_ = datasets(results, by, x, y, define)
1051 + max(sum(s.xmargin[:2]) for s in grid if s.x == 0)
1064 + max(sum(s.xmargin[:2]) for s in grid if s.x == 0)
1092 while minwidth > sum(widths[s.x:s.x+s.xspan]):
1093 widths[s.x+i] += 1
1121 subdatasets = datasets(results, by, x, y, define_)
1149 subwidth = sum(widths[s.x:s.x+s.xspan]) - sum(s.xmargin)
1165 sorted((x,y) for x,y in dataset.items()),
1395 type=lambda x: (
1397 )(*x.split('=', 1)),
1402 type=lambda x: (
1404 )(*x.split('=', 1)),
1410 type=lambda x: (
1412 )(*x.split('=', 1)),
1417 type=lambda x: (lambda k,v: (k, set(v.split(','))))(*x.split('=', 1)),
1441 type=lambda x: [x.strip() for x in x.split(',')],
1452 type=lambda x: int(x, 0),
1459 type=lambda x: int(x, 0),
1464 type=lambda x: tuple(
1465 dat(x) if x.strip() else None
1466 for x in x.split(',')),
1470 type=lambda x: tuple(
1471 dat(x) if x.strip() else None
1472 for x in x.split(',')),
1504 type=lambda x:
1505 [x.strip() for x in x.split(',')]
1506 if x.strip() else [],
1510 type=lambda x:
1511 [x.strip() for x in x.split(',')]
1512 if x.strip() else [],