2 ROS Anomaly Detector Framework 12 - Data persistence involves taking modified data and storing it. 13 - That data can easily be retrieved with this class. 29 Given a name of a file, returns location and name of where 30 the modified data is stored and retrieved from. 31 Used both of dumping and retrieving. 34 path_parts = name.split(
'.')[0].split(
'/')
35 file_name = path_parts[len(path_parts)-1]
36 path = [
'mod_data' if x==
'data' else x
for x
in path_parts[:-1]]
38 loc = path +
'/' + file_name +
'.npz' 40 if not os.path.exists(os.path.abspath(path)):
41 os.makedirs(os.path.abspath(path))
48 Given name of csv file, x and y data is stored in the 53 np.savez(open(loc,
'w+'), x=x, y=y)
60 Given location and file, file data is retrieved. def retrieve_dumped_data(self, name)
def dump_data(self, name, x, y)
def __store_data_loc(self, name)