Skip to content

Commit c0d0081

Browse files
author
Julian Kates-Harbeck
committed
made signal hash dependent on number of machines (explicitly on paths)
1 parent 8c48c7b commit c0d0081

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

plasma/conf_parser.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,12 @@ def parameters(input_file):
102102
params['paths']['use_signals_dict'] = jet_signals_1D
103103
elif params['paths']['data'] == 'jet_data_late':
104104
params['paths']['shot_files'] = [jet_iterlike_wall_late]
105-
params['paths']['shot_files_test'] = [jet_iterlike_wall_late]
105+
params['paths']['shot_files_test'] = []
106106
params['paths']['use_signals_dict'] = jet_signals
107107
elif params['paths']['data'] == 'jet_data_carbon_to_late_0D':
108108
params['paths']['shot_files'] = [jet_carbon_wall]
109109
params['paths']['shot_files_test'] = [jet_iterlike_wall_late]
110-
params['paths']['use_signals_dict'] = jet_signals
110+
params['paths']['use_signals_dict'] = jet_signals_0D
111111
elif params['paths']['data'] == 'jet_data_temp_profile':
112112
params['paths']['shot_files'] = [jet_carbon_wall]
113113
params['paths']['shot_files_test'] = [jet_iterlike_wall]
@@ -244,7 +244,7 @@ def parameters(input_file):
244244
return params
245245

246246
def get_unique_signal_hash(signals):
247-
return int(hashlib.md5(''.join(tuple(map(lambda x: x.description, sorted(signals)))).encode('utf-8')).hexdigest(),16)
247+
return int(hashlib.md5(''.join(tuple(map(lambda x: "{}".format(x.__hash__()), sorted(signals)))).encode('utf-8')).hexdigest(),16)
248248

249249
#make sure 1D signals come last! This is necessary for model builder.
250250
def sort_by_channels(list_of_signals):

plasma/primitives/data.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -171,21 +171,23 @@ def get_idx(self,machine):
171171
idx = self.machines.index(machine)
172172
return idx
173173

174+
def description_plus_paths(self):
175+
return self.description + ' ' + ' '.join(self.paths)
176+
174177
def __eq__(self,other):
175178
if other is None:
176179
return False
177-
return self.description.__eq__(other.description)
178-
180+
return self.description_plus_paths().__eq__(other.description_plus_paths())
179181

180182
def __ne__(self,other):
181-
return self.description.__ne__(other.description)
183+
return self.description_plus_paths().__ne__(other.description_plus_paths())
182184

183185
def __lt__(self,other):
184-
return self.description.__lt__(other.description)
186+
return self.description_plus_paths().__lt__(other.description_plus_paths())
185187

186188
def __hash__(self):
187189
import hashlib
188-
return int(hashlib.md5(self.description.encode('utf-8')).hexdigest(),16)
190+
return int(hashlib.md5(self.description_plus_paths().encode('utf-8')).hexdigest(),16)
189191

190192
def __str__(self):
191193
return self.description

0 commit comments

Comments
 (0)