(self)
| 20 | self.chunk_size = chunk_size or max(1, len(data) // self.n_processes) |
| 21 | |
| 22 | def process_data(self): |
| 23 | data_chunks = [self.data[i:i + self.chunk_size] for i in range(0, len(self.data), self.chunk_size)] |
| 24 | with Pool(processes=self.n_processes) as pool: |
| 25 | result_chunks = pool.map(self.func, data_chunks) |
| 26 | results = self.combine_results(result_chunks) |
| 27 | return results |
| 28 | |
| 29 | @staticmethod |
| 30 | def combine_results(result_chunks): |
no test coverage detected