def __init__(self, values):
        self._values = to_list(values)

        self._data = reader.read(self._values)
        Parser.check_data(spec=self, data=self._data)
        headers = Parser.get_headers(spec=self, data=self._data)
        matrix = Parser.get_matrix(spec=self, data=self._data)
        try:
            self._matrix = validator.validate_matrix(matrix)
        except ValidationError as e:
            raise PolyaxonConfigurationError(e)
        try:
            self._headers = validator.validate_headers(spec=self, data=headers)
        except ValidationError as e:
            raise PolyaxonConfigurationError(e)
        self._parsed_data = []
        self._validated_data = []
        self._experiment_specs = []

        matrix_declarations = self.matrix_declarations if self.matrix_declarations else [
            {}
        ]
        for i, matrix_declaration in enumerate(matrix_declarations):
            parsed_data = Parser.parse(self, self._data, matrix_declaration)
            self._validated_data.append(
                validator.validate(spec=self, data=parsed_data))
            self._parsed_data.append(parsed_data)
            self._experiment_specs.append(
                Specification(experiment=i, values=parsed_data))
    def __init__(self, values):
        self._values = to_list(values)

        self._data = reader.read(self._values)
        Parser.check_data(spec=self, data=self._data)
        headers = Parser.get_headers(spec=self, data=self._data)
        try:
            self._headers = validator.validate_headers(spec=self, data=headers)
        except ValidationError as e:
            raise PolyaxonConfigurationError(e)
        parsed_data = Parser.parse(self, self._data, None)
        self._validated_data = validator.validate(spec=self, data=parsed_data)
        self._parsed_data = parsed_data
Exemple #3
0
 def get_experiment_spec(self, matrix_declaration):
     """Returns and experiment spec for this group spec and the given matrix declaration."""
     parsed_data = Parser.parse(self, self._data, matrix_declaration)
     settings = SettingsConfig.get_experiment_settings(
         parsed_data[self.SETTINGS])
     del parsed_data[self.SETTINGS]
     if settings:
         parsed_data[self.SETTINGS] = settings
     validator.validate(spec=self, data=parsed_data)
     return ExperimentSpecification(
         values=[parsed_data, {
             'kind': self._EXPERIMENT
         }])
    def __init__(self, filepath):
        self._filepath = filepath

        self._data = reader.read(self._filepath)
        self._parsed_data = Parser.parse(self._data)
        self._validated_data = validator.validate(self._parsed_data)
Exemple #5
0
 def _set_parsed_data(self):
     parsed_data = Parser.parse(self, self._data, None)
     self._validated_data = validator.validate(spec=self, data=parsed_data)
     self._parsed_data = parsed_data
Exemple #6
0
 def _set_parsed_data(self):
     # We need to validate that the data is correct
     # For that we just use a matrix declaration test
     parsed_data = Parser.parse(self, self._data,
                                self.matrix_declaration_test)
     validator.validate(spec=self, data=parsed_data)