Passed
Push — master ( 193da7...4bb259 )
by Simon
01:36 queued 11s
created

SearchProcessLongMem.__init__()   A

Complexity

Conditions 1

Size

Total Lines 38
Code Lines 35

Duplication

Lines 38
Ratio 100 %

Importance

Changes 0
Metric Value
cc 1
eloc 35
nop 13
dl 38
loc 38
rs 9.0399
c 0
b 0
f 0

How to fix   Many Parameters   

Many Parameters

Methods with many parameters are not only hard to understand, but their parameters also often become inconsistent when you need more, or different data.

There are several approaches to avoid long parameter lists:

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__(
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
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
        )
53
54