Skip to content
Permalink
b1a05852fb
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
38 lines (34 sloc) 1.37 KB
import methods as m
class RunParams:
def __init__(self, base_dir, experiment_name, method, data_file, delim, distance_measure, dist_attr,
cor_measure=None, subspace_set=None, trivial_bins_count=None, sm_k=None):
self.dist_attr = dist_attr
self.sm_k = sm_k
self.trivial_bins_count = trivial_bins_count
self.cor_measure = cor_measure
self.distance_measure = distance_measure
self.subspace_set = subspace_set
self.delim = delim
self.data_file = data_file
self.method = method
self.experiment_name = experiment_name
self.base_dir = base_dir
def __repr__(self):
return "RunParams(experiment_name=" + self.experiment_name + ")"
def __getstate__(self):
return {
'dist_attr': self.dist_attr,
'sm_k': self.sm_k,
'trivial_bins_count': self.trivial_bins_count,
'cor_measure': self.cor_measure,
'distance_measure': self.distance_measure,
'subspace_set': self.subspace_set,
'delim': self.delim,
'data_file': self.data_file,
'method': self.method.name,
'experiment_name': self.experiment_name,
'base_dir': self.base_dir
}
def __setstate__(self, state):
self.__dict__.update(state)
self.method = m.Method[state['method']]