| Total Complexity | 1 |
| Total Lines | 48 |
| Duplicated Lines | 79.17 % |
| Changes | 0 | ||
Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.
Common duplication problems, and corresponding solutions are:
| 1 | # Author: Simon Blanke |
||
| 2 | # Email: [email protected] |
||
| 3 | # License: MIT License |
||
| 4 | |||
| 5 | from ..candidate import CandidateNoMem |
||
| 6 | from .search_process_base import SearchProcess |
||
| 7 | |||
| 8 | |||
| 9 | class SearchProcessNoMem(SearchProcess): |
||
| 10 | View Code Duplication | def __init__( |
|
|
|
|||
| 11 | self, |
||
| 12 | nth_process, |
||
| 13 | verb, |
||
| 14 | objective_function, |
||
| 15 | search_space, |
||
| 16 | n_iter, |
||
| 17 | function_parameter, |
||
| 18 | optimizer, |
||
| 19 | n_jobs, |
||
| 20 | init_para, |
||
| 21 | memory, |
||
| 22 | hyperactive, |
||
| 23 | random_state, |
||
| 24 | ): |
||
| 25 | super().__init__( |
||
| 26 | nth_process, |
||
| 27 | verb, |
||
| 28 | objective_function, |
||
| 29 | search_space, |
||
| 30 | n_iter, |
||
| 31 | function_parameter, |
||
| 32 | optimizer, |
||
| 33 | n_jobs, |
||
| 34 | init_para, |
||
| 35 | memory, |
||
| 36 | hyperactive, |
||
| 37 | random_state, |
||
| 38 | ) |
||
| 39 | |||
| 40 | self.cand = CandidateNoMem( |
||
| 41 | self.objective_function, |
||
| 42 | self.function_parameter, |
||
| 43 | self.search_space, |
||
| 44 | self.init_para, |
||
| 45 | self.memory, |
||
| 46 | verb, |
||
| 47 | hyperactive, |
||
| 48 | ) |
||
| 49 |