Coverage for skema/gromet/metadata/equation_extraction.py: 41%

70 statements  

« prev     ^ index     » next       coverage.py v7.5.0, created at 2024-04-30 17:15 +0000

1# coding: utf-8 

2 

3""" 

4 GroMEt Metadata spec 

5 

6 Grounded Model Exchange (GroMEt) Metadata schema specification __Using Swagger to Generate Class Structure__ To automatically generate Python or Java models corresponding to this document, you can use [swagger-codegen](https://swagger.io/tools/swagger-codegen/). We can use this to generate client code based off of this spec that will also generate the class structure. 1. Install via the method described for your operating system [here](https://github.com/swagger-api/swagger-codegen#Prerequisites). Make sure to install a version after 3.0 that will support openapi 3. 2. Run swagger-codegen with the options in the example below. The URL references where the yaml for this documentation is stored on github. Make sure to replace CURRENT_VERSION with the correct version. (The current version is `0.1.4`.) To generate Java classes rather, change the `-l python` to `-l java`. Change the value to the `-o` option to the desired output location. ``` swagger-codegen generate -l python -o ./client -i https://raw.githubusercontent.com/ml4ai/automates-v2/master/docs/source/gromet_metadata_v{CURRENT_VERSION}.yaml ``` 3. Once it executes, the client code will be generated at your specified location. For python, the classes will be located in `$OUTPUT_PATH/swagger_client/models/`. For java, they will be located in `$OUTPUT_PATH/src/main/java/io/swagger/client/model/` If generating GroMEt Metadata schema data model classes in SKEMA (AutoMATES), then after generating the above, follow the instructions here: ``` <automates>/automates/model_assembly/gromet/metadata/README.md ``` # noqa: E501 

7 

8 OpenAPI spec version: 0.1.8 

9 Contact: claytonm@arizona.edu 

10 Generated by: https://github.com/swagger-api/swagger-codegen.git 

11""" 

12 

13import pprint 

14import re # noqa: F401 

15 

16import six 

17 

18class EquationExtraction(object): 

19 """NOTE: This class is auto generated by the swagger code generator program. 

20 

21 Do not edit the class manually. 

22 """ 

23 """ 

24 Attributes: 

25 swagger_types (dict): The key is attribute name 

26 and the value is attribute type. 

27 attribute_map (dict): The key is attribute name 

28 and the value is json key in definition. 

29 """ 

30 swagger_types = { 

31 'gromet_type': 'str', 

32 'source_type': 'str', 

33 'document_reference_uid': 'str', 

34 'equation_number': 'int' 

35 } 

36 

37 attribute_map = { 

38 'gromet_type': 'gromet_type', 

39 'source_type': 'source_type', 

40 'document_reference_uid': 'document_reference_uid', 

41 'equation_number': 'equation_number' 

42 } 

43 

44 def __init__(self, gromet_type='EquationExtraction', source_type='equation_document_source', document_reference_uid=None, equation_number=None): # noqa: E501 

45 """EquationExtraction - a model defined in Swagger""" # noqa: E501 

46 self._gromet_type = None 

47 self._source_type = None 

48 self._document_reference_uid = None 

49 self._equation_number = None 

50 self.discriminator = None 

51 if gromet_type is not None: 

52 self.gromet_type = gromet_type 

53 if source_type is not None: 

54 self.source_type = source_type 

55 if document_reference_uid is not None: 

56 self.document_reference_uid = document_reference_uid 

57 if equation_number is not None: 

58 self.equation_number = equation_number 

59 

60 @property 

61 def gromet_type(self): 

62 """Gets the gromet_type of this EquationExtraction. # noqa: E501 

63 

64 

65 :return: The gromet_type of this EquationExtraction. # noqa: E501 

66 :rtype: str 

67 """ 

68 return self._gromet_type 

69 

70 @gromet_type.setter 

71 def gromet_type(self, gromet_type): 

72 """Sets the gromet_type of this EquationExtraction. 

73 

74 

75 :param gromet_type: The gromet_type of this EquationExtraction. # noqa: E501 

76 :type: str 

77 """ 

78 

79 self._gromet_type = gromet_type 

80 

81 @property 

82 def source_type(self): 

83 """Gets the source_type of this EquationExtraction. # noqa: E501 

84 

85 

86 :return: The source_type of this EquationExtraction. # noqa: E501 

87 :rtype: str 

88 """ 

89 return self._source_type 

90 

91 @source_type.setter 

92 def source_type(self, source_type): 

93 """Sets the source_type of this EquationExtraction. 

94 

95 

96 :param source_type: The source_type of this EquationExtraction. # noqa: E501 

97 :type: str 

98 """ 

99 

100 self._source_type = source_type 

101 

102 @property 

103 def document_reference_uid(self): 

104 """Gets the document_reference_uid of this EquationExtraction. # noqa: E501 

105 

106 uid of the source DocumentReference # noqa: E501 

107 

108 :return: The document_reference_uid of this EquationExtraction. # noqa: E501 

109 :rtype: str 

110 """ 

111 return self._document_reference_uid 

112 

113 @document_reference_uid.setter 

114 def document_reference_uid(self, document_reference_uid): 

115 """Sets the document_reference_uid of this EquationExtraction. 

116 

117 uid of the source DocumentReference # noqa: E501 

118 

119 :param document_reference_uid: The document_reference_uid of this EquationExtraction. # noqa: E501 

120 :type: str 

121 """ 

122 

123 self._document_reference_uid = document_reference_uid 

124 

125 @property 

126 def equation_number(self): 

127 """Gets the equation_number of this EquationExtraction. # noqa: E501 

128 

129 Number of equation (relative to document source) # noqa: E501 

130 

131 :return: The equation_number of this EquationExtraction. # noqa: E501 

132 :rtype: int 

133 """ 

134 return self._equation_number 

135 

136 @equation_number.setter 

137 def equation_number(self, equation_number): 

138 """Sets the equation_number of this EquationExtraction. 

139 

140 Number of equation (relative to document source) # noqa: E501 

141 

142 :param equation_number: The equation_number of this EquationExtraction. # noqa: E501 

143 :type: int 

144 """ 

145 

146 self._equation_number = equation_number 

147 

148 def to_dict(self): 

149 """Returns the model properties as a dict""" 

150 result = {} 

151 

152 for attr, _ in six.iteritems(self.swagger_types): 

153 value = getattr(self, attr) 

154 if isinstance(value, list): 

155 result[attr] = list(map( 

156 lambda x: x.to_dict() if hasattr(x, "to_dict") else x, 

157 value 

158 )) 

159 elif hasattr(value, "to_dict"): 

160 result[attr] = value.to_dict() 

161 elif isinstance(value, dict): 

162 result[attr] = dict(map( 

163 lambda item: (item[0], item[1].to_dict()) 

164 if hasattr(item[1], "to_dict") else item, 

165 value.items() 

166 )) 

167 else: 

168 result[attr] = value 

169 if issubclass(EquationExtraction, dict): 

170 for key, value in self.items(): 

171 result[key] = value 

172 

173 return result 

174 

175 def to_str(self): 

176 """Returns the string representation of the model""" 

177 return pprint.pformat(self.to_dict()) 

178 

179 def __repr__(self): 

180 """For `print` and `pprint`""" 

181 return self.to_str() 

182 

183 def __eq__(self, other): 

184 """Returns true if both objects are equal""" 

185 if not isinstance(other, EquationExtraction): 

186 return False 

187 

188 return self.__dict__ == other.__dict__ 

189 

190 def __ne__(self, other): 

191 """Returns true if both objects are not equal""" 

192 return not self == other