From 5e38ef62204196793b976bf4de9e17ed3751556c Mon Sep 17 00:00:00 2001 From: Pietro Date: Tue, 20 Apr 2021 14:31:27 +0200 Subject: [PATCH] Undefine node children time --- .gitignore | 1 + PyCTBN/PyCTBN/structure_graph/trajectory_generator.py | 2 -- PyCTBN/PyCTBN/utility/json_exporter.py | 4 ++-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 9607588..2f6ed10 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,4 @@ test_1.py test1.json test2.json test3.json +result0.png diff --git a/PyCTBN/PyCTBN/structure_graph/trajectory_generator.py b/PyCTBN/PyCTBN/structure_graph/trajectory_generator.py index 6c7662a..8b00186 100644 --- a/PyCTBN/PyCTBN/structure_graph/trajectory_generator.py +++ b/PyCTBN/PyCTBN/structure_graph/trajectory_generator.py @@ -18,8 +18,6 @@ class TrajectoryGenerator(object): for v in self._vnames: self._parents[v] = self._importer._df_structure.where(self._importer._df_structure["To"] == v).dropna()["From"].tolist() - print(self._parents) - self._cims = {} sampled_cims = self._importer._raw_data[0]["dyn.cims"] for v in sampled_cims.keys(): diff --git a/PyCTBN/PyCTBN/utility/json_exporter.py b/PyCTBN/PyCTBN/utility/json_exporter.py index a264675..1fbcccb 100644 --- a/PyCTBN/PyCTBN/utility/json_exporter.py +++ b/PyCTBN/PyCTBN/utility/json_exporter.py @@ -13,12 +13,12 @@ class JsonExporter(object): self._trajectories.append(trajectory) def out_json(self, filename): - data = { + data = [{ "dyn.str": self._dyn_str, "variables": self._variables, "dyn.cims": self._dyn_cims, "samples": self._trajectories - } + }] path = os.getcwd() with open(path + "/" + filename, "w") as json_file: