in data_measurements/lengths/lengths.py [0:0]
def __init__(self, dstats, load_only=False, save=True):
self.tokenized_df = dstats.tokenized_df
# Whether to only use cache
self.load_only = load_only
# Whether to try using cache first.
# Must be true when self.load_only = True; this function assures that.
self.use_cache = dstats.use_cache
self.cache_dir = dstats.dataset_cache_dir
self.save = save
# Lengths class object
self.lengths_obj = None
# Content shared in the DMT:
# The figure, the table, and the sufficient statistics (measurements)
self.fig_lengths = None
self.lengths_df = None
self.avg_length = None
self.std_length = None
self.uniq_counts = None
# Dict for the measurements, used in caching
self.length_stats_dict = {}
# Filenames, used in caching
self.lengths_dir = "lengths"
length_meas_json = "length_measurements.json"
lengths_fig_png = "lengths_fig.png"
lengths_df_json = "lengths_table.json"
self.length_stats_json_fid = pjoin(self.cache_dir, self.lengths_dir, length_meas_json)
self.lengths_fig_png_fid = pjoin(self.cache_dir, self.lengths_dir, lengths_fig_png)
self.lengths_df_json_fid = pjoin(self.cache_dir, self.lengths_dir, lengths_df_json)