Improve log system

This commit is contained in:
Noe Brucy
2022-08-26 20:06:38 +02:00
parent 07017611ee
commit 67f8f014d6
4 changed files with 74 additions and 39 deletions
+5 -6
View File
@@ -310,6 +310,11 @@ class SnapshotProcessor(HDF5Container):
unit_time : Unit instance, used for astrophysix
"""
self.path = path
self.run = os.path.basename(path)
self.num = num
self.log_id = "{}, {}".format(self.run, self.num)
super(SnapshotProcessor, self).__init__(path, path_out, params, tag)
# Open outfile
@@ -334,10 +339,6 @@ class SnapshotProcessor(HDF5Container):
if not os.path.exists(f"{self.path_out}{subfolder}"):
os.makedirs(f"{self.path_out}{subfolder}")
self.path = path
self.run = os.path.basename(path)
self.num = num
# Create selector object
if selector is None:
selector = RunSelector(
@@ -373,8 +374,6 @@ class SnapshotProcessor(HDF5Container):
self.save.root._v_attrs.time = self.time
self.close()
self.log_id = "[{}, {}] ".format(self.run, self.num)
if os.path.exists(self.filaments_filename):
with open(self.filaments_filename, "rb") as f:
self.fil = pickle.load(f)