def display_data(self, rows, cols, side_length=None): (data_rows, data_cols, data) = self.data_heat_map.get_data() if side_length is None: side_length = self.side_length if rows is not None: rows = getData.caseless_intersection_list(rows, data_rows, use_left=False) self.rows = rows else: rows = self.rows if cols is not None: cols = getData.caseless_intersection_list(cols, data_cols, use_left=False) heat_map = self.display_heat_map = self.data_heat_map.projection(rows, cols) (self.dx, self.dy) = heat_map.fit(self.svg, side_length, self.labels_space) self.row = self.col = None self.svg.empty() return self.draw()
def checked_names(subset, superset, strict=False): """ Check that names in subset are in superset. Return list of such names. Raise a ValueError if strict is set and the subset contains an element not in superset. """ ss = set(subset) sp = set(superset) proper = set(getData.caseless_intersection_list(ss, sp)) # ss & sp if strict and proper != ss: raise ValueError("extra names not allowed: " + repr(ss-sp)) result = [name for name in subset if name in sp] return result