(self, flatValues)
| 338 | return flatValues |
| 339 | |
| 340 | def convertToStructuredValues(self, flatValues): |
| 341 | if "anyOf" in self.config or "oneOf" in self.config: |
| 342 | v = "anyOf" if "anyOf" in self.config else "oneOf" |
| 343 | data = self.config[v] |
| 344 | |
| 345 | subParameterIndex = flatValues[self.name] |
| 346 | subParam = Hyperparameter( |
| 347 | data[subParameterIndex], self, self.root + "." + str(subParameterIndex) |
| 348 | ) |
| 349 | |
| 350 | structured = subParam.convertToStructuredValues(flatValues) |
| 351 | structured["$index"] = subParameterIndex |
| 352 | |
| 353 | return structured |
| 354 | elif "constant" in self.config: |
| 355 | return flatValues[self.name] |
| 356 | elif "enum" in self.config: |
| 357 | return flatValues[self.name] |
| 358 | elif self.config["type"] == "object": |
| 359 | result = {} |
| 360 | for key in self.config["properties"].keys(): |
| 361 | config = self.config["properties"][key] |
| 362 | |
| 363 | subStructuredValue = Hyperparameter( |
| 364 | config, self, self.root + "." + key |
| 365 | ).convertToStructuredValues(flatValues) |
| 366 | |
| 367 | result[key] = subStructuredValue |
| 368 | |
| 369 | if self.name == "": |
| 370 | for key in flatValues.keys(): |
| 371 | if key.startswith("$"): |
| 372 | result[key] = flatValues[key] |
| 373 | return result |
| 374 | elif self.config["type"] == "number": |
| 375 | return flatValues[self.name] |
| 376 | |
| 377 | @staticmethod |
| 378 | def createHyperparameterConfigForHyperoptDomain(domain): |
nothing calls this directly
no test coverage detected