def test_top_level_meta(self):
        author = Author.create_author("Wouter van Veen")

        path = self._test_path
        meta = Meta.create_top_level_meta(None, author, "")
        dataset = StructuredDataSet.create_dataset(path, "test_meta", meta)
        dataset.write()
Esempio n. 2
0
    def create_dataset(path: Path,
                       name: str,
                       author: Author,
                       description: str = "") -> "StructuredDataSet":
        top_level_meta = Meta.create_top_level_meta(None,
                                                    author,
                                                    description=description)
        path_tmp = path / "{:s}.struct".format(name)
        path_meta = path_tmp / ".meta.json"
        top_level_meta.path = path_meta

        return StructuredDataSet(path, name, {}, top_level_meta)
    def test_branching(self):
        author = Author.create_author("Wouter van Veen")

        path = self._test_path
        meta = Meta.create_top_level_meta(None, author, "")
        dataset = StructuredDataSet.create_dataset(path, "test_meta_branching",
                                                   meta)

        x = dataset["x"]

        x["xx"] = numpy.zeros(30)

        dataset.write()
        x.meta.write()