예제 #1
0
 def _initialize_by_counts(self, row_count, column_count):
     for i in range(row_count):
         row = PitchArrayRow([])
         for j in range(column_count):
             cell = PitchArrayCell()
             row.append(cell)
         self.append_row(row)
예제 #2
0
 def _initialize_by_cell_token_lists(self, cell_token_lists):
     for cell_token_list in cell_token_lists:
         row = PitchArrayRow([])
         for cell_token in cell_token_list:
             cell = self._parse_cell_token(cell_token)
             row.append(cell)
         self.append_row(row)
예제 #3
0
    def pad_to_depth(self, depth):
        r'''Pads pitch array to `depth`.

        Returns none.
        '''
        self_depth = self.depth
        if depth < self_depth:
            message = 'pad depth must be not less than array depth.'
            raise ValueError(message)
        self_width = self.width
        missing_rows = depth - self_depth
        for i in range(missing_rows):
            row = PitchArrayRow([])
            row.pad_to_width(self_width)
            self.append_row(row)