def closeto_bbox(b1, b2): xmin1, xmax1 = b1.intervalx().get_bounds() ymin1, ymax1 = b1.intervaly().get_bounds() xmin2, xmax2 = b2.intervalx().get_bounds() ymin2, ymax2 = b2.intervaly().get_bounds() pairs = ( (xmin1, xmin2), (xmax1, xmax2), (ymin1, ymin2), (ymax1, ymax2)) return alltrue([closeto(x,y) for x,y in pairs])
def closeto_bbox(b1, b2): xmin1, xmax1 = b1.intervalx().get_bounds() ymin1, ymax1 = b1.intervaly().get_bounds() xmin2, xmax2 = b2.intervalx().get_bounds() ymin2, ymax2 = b2.intervaly().get_bounds() pairs = ((xmin1, xmin2), (xmax1, xmax2), (ymin1, ymin2), (ymax1, ymax2)) return alltrue([closeto(x, y) for x, y in pairs])
def seq_allequal(seq1, seq2): """ seq1 and seq2 are either None or sequences or numerix arrays Return True if both are None or both are seqs with identical elements """ if seq1 is None: return seq2 is None if seq2 is None: return False #ok, neither are None:, assuming iterable if len(seq1) != len(seq2): return False return alltrue(equal(seq1, seq2))
def closeto_seq(xs,ys): return alltrue([closeto(x,y) for x,y in zip(xs, ys)])
def closeto_seq(xs, ys): return alltrue([closeto(x, y) for x, y in zip(xs, ys)])