Skip to content

Commit

Permalink
remove useless read_k_cylinder
Browse files Browse the repository at this point in the history
  • Loading branch information
Chenggong committed Nov 8, 2023
1 parent 31d99e9 commit cf719a0
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions Sfilter/util/output_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from scipy.stats import gaussian_kde
from scipy.stats import bootstrap
from collections import Counter
import gc


def read_cylinder(cylinder_file):
Expand Down Expand Up @@ -386,13 +387,10 @@ def __init__(self, files, start=0, end=None, step=1, method="K_priority", time_s
raise TypeError("files must be a list of str or str")
self.state_str = []
self.meta_data = []
data_list = []
for f in self.files:
data_list.append(read_k_cylinder(f, method))
for f in self.files:
s_list, meta_data, K_occu, W_occu = read_k_cylinder(f, method, get_occu=False)
# for s_list, meta_data, K_occu, W_occu in [read_k_cylinder(f, method, get_occu=False) for f in self.files]:
self.state_str.append(s_list[start:end:step])
s_list_sliced = s_list[start:end:step]
self.state_str.append(s_list_sliced)
if time_step is None:
if "time_step" not in meta_data:
raise ValueError("time_step is not provided in the output file, please provide it manually")
Expand All @@ -401,6 +399,10 @@ def __init__(self, files, start=0, end=None, step=1, method="K_priority", time_s
else:
meta_data["time_step"] = time_step * step
self.meta_data.append(meta_data)
# del s_list # free memory
# del K_occu
# del W_occu
# gc.collect()

def get_state_distribution(self, state_list=None):
"""
Expand Down

0 comments on commit cf719a0

Please sign in to comment.