Comment 7 for bug 1674341

Revision history for this message
Mexxxanick (mexxxanick) wrote :

hacky patch to fix the issue:

--- ../various/lhe_parser_old.py 2017-05-02 22:06:50.418781940 -0500
+++ ../various/lhe_parser.py 2017-05-02 22:07:10.571591216 -0500
@@ -569,6 +569,7 @@
     def split(self, nb_event=0, partition=None, cwd=os.path.curdir, zip=False):
         """split the file in multiple file. Do not change the weight!"""

+ empty_event = str(Event())
         nb_file = -1
         for i, event in enumerate(self):
             if (not (partition is None) and i==sum(partition[:nb_file+1])) or \
@@ -587,6 +588,8 @@
                 else:
                     current = open(pjoin(cwd,'%s_%s.lhe' % (self.name, nb_file)),'w')
                 current.write(self.banner)
+ if empty_event in str(event):
+ continue
             current.write(str(event))
         if i!=0:
             current.write('</LesHouchesEvent>\n')

There's probably better solution, but this helped me...