| Total Complexity | 1 |
| Total Lines | 52 |
| Duplicated Lines | 73.08 % |
| 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 | |||
| 6 | import numpy as np |
||
| 7 | import pandas as pd |
||
| 8 | |||
| 9 | from ..candidate import CandidateShortMem |
||
| 10 | from .search_process_shortMem import SearchProcessShortMem |
||
| 11 | |||
| 12 | |||
| 13 | class SearchProcessLongMem(SearchProcessShortMem): |
||
| 14 | View Code Duplication | def __init__( |
|
|
|
|||
| 15 | self, |
||
| 16 | nth_process, |
||
| 17 | verb, |
||
| 18 | objective_function, |
||
| 19 | search_space, |
||
| 20 | n_iter, |
||
| 21 | function_parameter, |
||
| 22 | optimizer, |
||
| 23 | n_jobs, |
||
| 24 | init_para, |
||
| 25 | memory, |
||
| 26 | hyperactive, |
||
| 27 | random_state, |
||
| 28 | ): |
||
| 29 | super().__init__( |
||
| 30 | nth_process, |
||
| 31 | verb, |
||
| 32 | objective_function, |
||
| 33 | search_space, |
||
| 34 | n_iter, |
||
| 35 | function_parameter, |
||
| 36 | optimizer, |
||
| 37 | n_jobs, |
||
| 38 | init_para, |
||
| 39 | memory, |
||
| 40 | hyperactive, |
||
| 41 | random_state, |
||
| 42 | ) |
||
| 43 | |||
| 44 | self.cand = CandidateShortMem( |
||
| 45 | self.objective_function, |
||
| 46 | self.function_parameter, |
||
| 47 | self.search_space, |
||
| 48 | self.init_para, |
||
| 49 | self.memory, |
||
| 50 | verb, |
||
| 51 | hyperactive, |
||
| 52 | ) |
||
| 54 |