|
5 | 5 | """ |
6 | 6 |
|
7 | 7 | import dataclasses |
8 | | -import re |
9 | | -import sys |
10 | 8 | from dataclasses import dataclass |
11 | 9 | from typing import Any, ClassVar, Dict, List, Optional, Union |
12 | 10 |
|
13 | | -from jsonasobj2 import JsonObj, as_dict |
14 | | -from linkml_runtime.linkml_model.meta import EnumDefinition, PermissibleValue, PvFormulaOptions |
15 | 11 | from linkml_runtime.utils.curienamespace import CurieNamespace |
16 | | -from linkml_runtime.utils.dataclass_extensions_376 import dataclasses_init_fn_with_kwargs |
17 | | -from linkml_runtime.utils.enumerations import EnumDefinitionImpl |
18 | | -from linkml_runtime.utils.formatutils import camelcase, sfx, underscore |
| 12 | +from linkml_runtime.utils.dataclass_extensions_376 import ( |
| 13 | + dataclasses_init_fn_with_kwargs, |
| 14 | +) |
19 | 15 | from linkml_runtime.utils.metamodelcore import ( |
20 | 16 | URI, |
21 | 17 | Bool, |
|
27 | 23 | XSDDate, |
28 | 24 | XSDDateTime, |
29 | 25 | XSDTime, |
30 | | - bnode, |
31 | | - empty_dict, |
32 | 26 | empty_list, |
33 | 27 | ) |
34 | 28 | from linkml_runtime.utils.slot import Slot |
35 | | -from linkml_runtime.utils.yamlutils import YAMLRoot, extended_float, extended_int, extended_str |
36 | | -from rdflib import Namespace, URIRef |
| 29 | +from linkml_runtime.utils.yamlutils import ( |
| 30 | + YAMLRoot, |
| 31 | + extended_str, |
| 32 | +) |
| 33 | +from rdflib import URIRef |
37 | 34 |
|
38 | 35 | metamodel_version = "1.7.0" |
39 | 36 |
|
@@ -232,54 +229,78 @@ def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): |
232 | 229 | self.members = [v if isinstance(v, str) else str(v) for v in self.members] |
233 | 230 |
|
234 | 231 | if not isinstance(self.members_labels, list): |
235 | | - self.members_labels = [self.members_labels] if self.members_labels is not None else [] |
236 | | - self.members_labels = [v if isinstance(v, str) else str(v) for v in self.members_labels] |
| 232 | + self.members_labels = ( |
| 233 | + [self.members_labels] if self.members_labels is not None else [] |
| 234 | + ) |
| 235 | + self.members_labels = [ |
| 236 | + v if isinstance(v, str) else str(v) for v in self.members_labels |
| 237 | + ] |
237 | 238 |
|
238 | 239 | if self.num_members is not None and not isinstance(self.num_members, int): |
239 | 240 | self.num_members = int(self.num_members) |
240 | 241 |
|
241 | | - if self.max_confidence is not None and not isinstance(self.max_confidence, float): |
| 242 | + if self.max_confidence is not None and not isinstance( |
| 243 | + self.max_confidence, float |
| 244 | + ): |
242 | 245 | self.max_confidence = float(self.max_confidence) |
243 | 246 |
|
244 | | - if self.min_confidence is not None and not isinstance(self.min_confidence, float): |
| 247 | + if self.min_confidence is not None and not isinstance( |
| 248 | + self.min_confidence, float |
| 249 | + ): |
245 | 250 | self.min_confidence = float(self.min_confidence) |
246 | 251 |
|
247 | | - if self.avg_confidence is not None and not isinstance(self.avg_confidence, float): |
| 252 | + if self.avg_confidence is not None and not isinstance( |
| 253 | + self.avg_confidence, float |
| 254 | + ): |
248 | 255 | self.avg_confidence = float(self.avg_confidence) |
249 | 256 |
|
250 | 257 | if self.is_conflated is not None and not isinstance(self.is_conflated, Bool): |
251 | 258 | self.is_conflated = Bool(self.is_conflated) |
252 | 259 |
|
253 | | - if self.is_all_conflated is not None and not isinstance(self.is_all_conflated, Bool): |
| 260 | + if self.is_all_conflated is not None and not isinstance( |
| 261 | + self.is_all_conflated, Bool |
| 262 | + ): |
254 | 263 | self.is_all_conflated = Bool(self.is_all_conflated) |
255 | 264 |
|
256 | | - if self.total_conflated is not None and not isinstance(self.total_conflated, int): |
| 265 | + if self.total_conflated is not None and not isinstance( |
| 266 | + self.total_conflated, int |
| 267 | + ): |
257 | 268 | self.total_conflated = int(self.total_conflated) |
258 | 269 |
|
259 | 270 | if self.proportion_conflated is not None and not isinstance( |
260 | 271 | self.proportion_conflated, float |
261 | 272 | ): |
262 | 273 | self.proportion_conflated = float(self.proportion_conflated) |
263 | 274 |
|
264 | | - if self.conflation_score is not None and not isinstance(self.conflation_score, float): |
| 275 | + if self.conflation_score is not None and not isinstance( |
| 276 | + self.conflation_score, float |
| 277 | + ): |
265 | 278 | self.conflation_score = float(self.conflation_score) |
266 | 279 |
|
267 | 280 | if self.members_count is not None and not isinstance(self.members_count, int): |
268 | 281 | self.members_count = int(self.members_count) |
269 | 282 |
|
270 | | - if self.min_count_by_source is not None and not isinstance(self.min_count_by_source, int): |
| 283 | + if self.min_count_by_source is not None and not isinstance( |
| 284 | + self.min_count_by_source, int |
| 285 | + ): |
271 | 286 | self.min_count_by_source = int(self.min_count_by_source) |
272 | 287 |
|
273 | | - if self.max_count_by_source is not None and not isinstance(self.max_count_by_source, int): |
| 288 | + if self.max_count_by_source is not None and not isinstance( |
| 289 | + self.max_count_by_source, int |
| 290 | + ): |
274 | 291 | self.max_count_by_source = int(self.max_count_by_source) |
275 | 292 |
|
276 | | - if self.avg_count_by_source is not None and not isinstance(self.avg_count_by_source, float): |
| 293 | + if self.avg_count_by_source is not None and not isinstance( |
| 294 | + self.avg_count_by_source, float |
| 295 | + ): |
277 | 296 | self.avg_count_by_source = float(self.avg_count_by_source) |
278 | 297 |
|
279 | 298 | if self.harmonic_mean_count_by_source is not None and not isinstance( |
280 | 299 | self.harmonic_mean_count_by_source, float |
281 | 300 | ): |
282 | | - self.harmonic_mean_count_by_source = float(self.harmonic_mean_count_by_source) |
| 301 | + self.harmonic_mean_count_by_source = float( |
| 302 | + self.harmonic_mean_count_by_source |
| 303 | + ) |
283 | 304 |
|
284 | 305 | super().__post_init__(**kwargs) |
285 | 306 |
|
|
0 commit comments