1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 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 61 62 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 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128
|
#!/usr/bin/env python3
""" Project Keys as Enum Classes
Copyright (C) 2023 RicksLab
This program is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
more details.
You should have received a copy of the GNU General Public License along with
this program. If not, see <https://www.gnu.org/licenses/>.
"""
__author__ = 'RicksLab'
__credits__ = ['']
__copyright__ = 'Copyright (C) 2023 RicksLab'
__license__ = 'GNU General Public License'
__program_name__ = 'gpu-utils'
__maintainer__ = 'RicksLab'
__docformat__ = 'reStructuredText'
# pylint: disable=multiple-statements
# pylint: disable=line-too-long
# pylint: disable=logging-format-interpolation
# pylint: disable=consider-using-f-string
# pylint: disable=invalid-name
from enum import Enum, auto
from typing import List
class GpuEnum(Enum):
""" Define Critical dictionary/dataFrame keys and Enum objects. Be careful when modifying. A change
in enum value could invalidate saved pickled model parameters.
"""
def __str__(self) -> str:
return self.name
def __repr__(self) -> str:
return self.__str__()
@classmethod
def list(cls) -> List[str]:
""" Return a list of name from current UpsEnum object """
return list(map(lambda c: c.name, cls))
class GpuType(GpuEnum):
""" Enum object to define keys for GPU type.
"""
ALL = auto()
Undefined = auto()
Unsupported = auto()
Supported = auto()
Legacy = auto()
LegacyAPU = auto()
APU = auto()
Modern = auto()
PStatesNE = auto()
PStates = auto()
CurvePts = auto()
Offset = auto()
NotSet = auto()
class GpuCompatibility(GpuEnum):
""" Enum object to define keys for GPU Compatibility.
"""
ALL = auto()
ReadWrite = auto()
ReadOnly = auto()
WriteOnly = auto()
Readable = auto()
Writable = auto()
Not = auto()
class GpuVendor(GpuEnum):
""" Enum object to define keys for GPU Vendor.
"""
ALL = auto()
Undefined = auto()
AMD = auto()
NVIDIA = auto()
INTEL = auto()
ASPEED = auto()
MATROX = auto()
PCIE = auto()
class SensorSet(GpuEnum):
""" Enum object to define keys for GPU Sensor Sets.
"""
Static = auto()
Dynamic = auto()
Info = auto()
State = auto()
Monitor = auto()
All = auto()
class SensorType(GpuEnum):
""" Enum object to define keys for GPU Sensor Types.
"""
SingleParam = auto()
SingleString = auto()
SingleStringSelect = auto()
MinMax = auto()
MLSS = auto()
InputLabel = auto()
InputLabelX = auto()
MLMS = auto()
AllPStates = auto()
class OdMode(GpuEnum):
""" Enum object to define keys for GPU overdrive modes.
"""
none = auto()
value = auto()
range = auto()
curve = auto()
offset = auto()
|