You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

constant.py 2.7 kB

5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. # Copyright 2019 Huawei Technologies Co., Ltd
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License");
  4. # you may not use this file except in compliance with the License.
  5. # You may obtain a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software
  10. # distributed under the License is distributed on an "AS IS" BASIS,
  11. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. # See the License for the specific language governing permissions and
  13. # limitations under the License.
  14. # ============================================================================
  15. """Constant module."""
  16. from enum import Enum
  17. class MindInsightModules(Enum):
  18. """
  19. Enum definition for MindInsight error types.
  20. Note:
  21. Each enum value, excluding GENERAL, has an Errors class name starting with the enum value
  22. in Camel-Case referring to specific module.
  23. """
  24. GENERAL = 0
  25. LINEAGEMGR = 2
  26. DATAVISUAL = 5
  27. PROFILERMGR = 6
  28. SCRIPTCONVERTER = 7
  29. WIZARD = 9
  30. OPTIMIZER = 10
  31. DEBUGGER = 11
  32. class GeneralErrors(Enum):
  33. """Enum definition for general errors."""
  34. UNKNOWN_ERROR = 0
  35. PARAM_TYPE_ERROR = 1
  36. PARAM_VALUE_ERROR = 2
  37. PARAM_MISSING_ERROR = 3
  38. PATH_NOT_EXISTS_ERROR = 4
  39. FILE_SYSTEM_PERMISSION_ERROR = 8
  40. PORT_NOT_AVAILABLE_ERROR = 9
  41. URL_DECODE_ERROR = 10
  42. COMPUTING_RESOURCE_ERROR = 11
  43. class ProfilerMgrErrors(Enum):
  44. """Enum definition for profiler errors."""
  45. class LineageMgrErrors(Enum):
  46. """Enum definition for lineage errors."""
  47. class DebuggerErrors(Enum):
  48. """Enum definition for debugger errors."""
  49. class DataVisualErrors(Enum):
  50. """Enum definition for datavisual errors."""
  51. RESTFUL_API_NOT_EXIST = 1
  52. REQUEST_METHOD_NOT_ALLOWED = 2
  53. MAX_COUNT_EXCEEDED_ERROR = 3
  54. CRC_FAILED = 4
  55. TRAIN_JOB_NOT_EXIST = 5
  56. SUMMARY_LOG_PATH_INVALID = 6
  57. SUMMARY_LOG_IS_LOADING = 7
  58. NODE_NOT_IN_GRAPH_ERROR = 9
  59. PATH_NOT_DIRECTORY_ERROR = 10
  60. PLUGIN_NOT_AVAILABLE = 11
  61. GRAPH_NOT_EXIST = 12
  62. IMAGE_NOT_EXIST = 13
  63. SCALAR_NOT_EXIST = 14
  64. HISTOGRAM_NOT_EXIST = 15
  65. TRAIN_JOB_DETAIL_NOT_IN_CACHE = 16
  66. QUERY_STRING_CONTAINS_NULL_BYTE = 17
  67. TENSOR_NOT_EXIST = 18
  68. MAX_RESPONSE_DATA_EXCEEDED_ERROR = 19
  69. STEP_TENSOR_DATA_NOT_IN_CACHE = 20
  70. class ScriptConverterErrors(Enum):
  71. """Enum definition for mindconverter errors."""
  72. class WizardErrors(Enum):
  73. """Enum definition for mindwizard errors."""
  74. class OptimizerErrors(Enum):
  75. """Enum definition for optimizer errors."""
  76. SAMPLES_NOT_ENOUGH = 1
  77. CORRELATION_NAN = 2