Skip to content
Snippets Groups Projects
Commit ac2bc330 authored by mimc's avatar mimc
Browse files

Some minor bug fixes

parent 29328629
No related branches found
No related tags found
No related merge requests found
Pipeline #6106 failed
......@@ -153,6 +153,8 @@ class Hawc2_Simulation(object):
old_home = os.getcwd()
# Change to the htc directory
if not os.path.isdir(self.write_directory):
os.mkdir(self.write_directory)
os.chdir(self.write_directory)
# scale sensors for writing
......
......@@ -176,6 +176,7 @@ class StBaseData(object):
else:
raise IndexError('The keys cannot have more than 3 terms')
if len(sub_set_data)!=len(val):
print('The size of the data is %d and the size of the value is %d'%(len(sub_set_data), len(val)))
raise IndexError('The value is not the same size as the data')
if data_id in key_str:
col_id = key_str.index(data_id)
......@@ -277,6 +278,9 @@ class StBaseData(object):
if not is_int(header_words[0]):
raise Exception('First term in the header of an ST file must be the number of main sets')
no_maindata_sets = int(header_words[0])
if no_maindata_sets != txt.count("#"):
print('About to throw an error because the file "%s" does not have the correct number of # characters'%(filename))
print('The number of sets in the header is %d and the number of sets in the file is %d'%(no_maindata_sets,txt.count("#")))
assert no_maindata_sets == txt.count("#")
self.main_data_sets = {}
for mset in main_sets[1:]:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment