def validate(self, args_dict): schema_dict = self.CONFIGURATION.get('input_schema', None) if schema_dict is None: return jsonSchema = JSONSchema(schema_dict) schema_property_names = jsonSchema.get_default_section_names() json_dict = {} for property_name in schema_property_names: if property_name in args_dict: json_dict[property_name] = args_dict[property_name] jsonSchema.validate(json_dict)
def validate(self, args_dict): """ Validates the configuration against the input schema. N.B. Not in use at the moment. """ schema_dict = self.CONFIGURATION.get('input_schema', None) if schema_dict is None: return jsonSchema = JSONSchema(schema_dict) schema_property_names = jsonSchema.get_default_section_names() json_dict = {} for property_name in schema_property_names: if property_name in args_dict: json_dict[property_name] = args_dict[property_name] jsonSchema.validate(json_dict)
def validate(self, args_dict): schema_dict = self.CONFIGURATION.get('input_schema') if schema_dict is None: return jsonSchema = JSONSchema(schema_dict) schema_property_names = jsonSchema.get_default_section_names() json_dict = {} for property_name in schema_property_names: if property_name in args_dict: value = args_dict[property_name] if isinstance(value, np.ndarray): value = value.tolist() json_dict[property_name] = value jsonSchema.validate(json_dict)