Skip to content

performance_assessor.py

Launch this script in order to test the program's performance.

Usage

    # Execute this command line in a conda environment.
    $ python -m src.smiffer.performance_profile

ArgumentParser dataclass

To simulate parsed arguments

Source code in src/misc/performance_assessor.py
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
@dataclass
class ArgumentParser:
    """To simulate parsed arguments"""

    def __init__(self, pdb_input: str, output: str, parameter: str, apbs: str):
        """Initiate a ArgumentParser dataclass object.

        Parameters
        ----------
        pdb_input : `str`
            Input PDB.

        output : `str`
            Output directory.

        parameter : `str`
            YAML parameters file.

        apbs : `str`
            APBS file.
        """
        self.input: str = pdb_input
        self.output: str = output
        self.parameter: str = parameter
        self.apbs: str = apbs
        self.verbose: bool = False

__init__(pdb_input, output, parameter, apbs)

Initiate a ArgumentParser dataclass object.

Parameters

pdb_input : str
Input PDB.

str

Output directory.

str

YAML parameters file.

str

APBS file.

Source code in src/misc/performance_assessor.py
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
def __init__(self, pdb_input: str, output: str, parameter: str, apbs: str):
    """Initiate a ArgumentParser dataclass object.

    Parameters
    ----------
    pdb_input : `str`
        Input PDB.

    output : `str`
        Output directory.

    parameter : `str`
        YAML parameters file.

    apbs : `str`
        APBS file.
    """
    self.input: str = pdb_input
    self.output: str = output
    self.parameter: str = parameter
    self.apbs: str = apbs
    self.verbose: bool = False

to_test(pdb_input, output, parameter, apbs)

The function to launch in order to test the program efficiency.

Parameters

pdb_input : str
The PDB to input.

str

The PDB to output.

str

The YAML parameter to test.

str

The APBS file to use.

Source code in src/misc/performance_assessor.py
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
def to_test(
    pdb_input: str,
    output: str,
    parameter: str,
    apbs: str,
):
    """The function to launch in order to test the program efficiency.

    Parameters
    ----------
    pdb_input : `str`
        The PDB to input.

    output : `str`
        The PDB to output.

    parameter : `str`
        The YAML parameter to test.

    apbs : `str`
        The APBS file to use.
    """
    argument = ArgumentParser(pdb_input, output, parameter, apbs)

    # YAML parsing.
    yaml = parse_yaml(argument.parameter, argument.verbose)
    yaml.clean()

    grid(yaml=yaml, argument=argument, date="0000_00_00")