def save_single(self):
assert(self.V is not None)
assert(self._ref is not None)
# Set the size explictly as a sanity check
size_n, dim_V = self.V.shape
config_score = simple_config.load()["score"]
f_db = os.path.join(
config_score["output_data_directory"],
config_score["document_scores"]["f_db"]
)
h5 = touch_h5(f_db)
g = h5.require_group(self.method)
gx = g.require_group(self.current_filename)
# Save the data array
msg = "Saving {} {} ({})"
print(msg.format(self.method, self.current_filename, size_n))
for col in ["V", "_ref", "VX",
"VX_explained_variance_ratio_",
"VX_components_"]:
if col in gx:
#print " Clearing", self.method, self.current_filename, col
del gx[col]
gx.create_dataset("V", data=self.V, **self.h5py_args)
gx.create_dataset("_ref", data=self._ref, **self.h5py_args)
评论列表
文章目录