When trying to run a reweighting of a SMEFTsim model in v3.4.2, I get the error
```
reweight -from_cards
INFO: Extracting the banner ...
INFO: process: u u~ > h u u~ NP<=1
INFO: options: SMHLOOP=0
INFO: Running Reweighting
change rwgt_dir rwgt
launch --rwgt_name=rw_sm
INFO: detected model: SMEFTsim_topU3l_MwScheme_UFO. Loading...
CRITICAL: Model with non QCD emission of gluon (found 14 of those).
This type of model is not fully supported within MG5aMC.
Restriction on LO dynamical scale and MLM matching/merging can occur for some processes.
Use such features with care.
CRITICAL: Model with non QCD emission of gluon (found 14 of those).
This type of model is not fully supported within MG5aMC.
Restriction on LO dynamical scale and MLM matching/merging can occur for some processes.
Use such features with care.
INFO: generating the square matrix element for reweighting
INFO: generate u u~ > h u u~ NP<=1 SMHLOOP=0 ;
INFO: Done 12.39
Command "launch" interrupted with error:
AttributeError : 'int' object has no attribute 'decode'
Please report this bug on https://bugs.launchpad.net/mg5amcnlo
More information is found in '/root/data/uuhuu/run_01_tag_1_debug.log'.
Please attach this file to your report.
```
Looking at run_01_tag_1_debug.log I see the following traceback:
```
Traceback (most recent call last):
File "/root/data/uuhuu/bin/internal/extended_cmd.py", line 1544, in onecmd
return self.onecmd_orig(line, **opt)
File "/root/data/uuhuu/bin/internal/extended_cmd.py", line 1493, in onecmd_orig
return func(arg, **opt)
File "/root/data/uuhuu/bin/internal/madevent_interface.py", line 2763, in do_launch
self.do_generate_events(line, *args, **opt)
File "/root/data/uuhuu/bin/internal/madevent_interface.py", line 2404, in do_generate_events
self.run_generate_events(switch_mode, args)
File "/root/data/uuhuu/bin/internal/common_run_interface.py", line 7634, in new_fct
original_fct(obj, *args, **opts)
File "/root/data/uuhuu/bin/internal/madevent_interface.py", line 2657, in run_generate_events
self.exec_cmd('reweight -from_cards', postcmd=False)
File "/root/data/uuhuu/bin/internal/extended_cmd.py", line 1573, in exec_cmd
stop = Cmd.onecmd_orig(current_interface, line, **opt)
File "/root/data/uuhuu/bin/internal/extended_cmd.py", line 1493, in onecmd_orig
return func(arg, **opt)
File "/root/data/uuhuu/bin/internal/common_run_interface.py", line 2238, in do_reweight
reweight_cmd.import_command_file(path)
File "/usr/local/venv/MG5_aMC/madgraph/interface/extended_cmd.py", line 1692, in import_command_file
self.exec_cmd(line, precmd=True)
File "/usr/local/venv/MG5_aMC/madgraph/interface/extended_cmd.py", line 1573, in exec_cmd
stop = Cmd.onecmd_orig(current_interface, line, **opt)
File "/usr/local/venv/MG5_aMC/madgraph/interface/extended_cmd.py", line 1493, in onecmd_orig
return func(arg, **opt)
File "/usr/local/venv/MG5_aMC/madgraph/various/misc.py", line 111, in f_with_no_logger
out = f(self, *args, **opt)
File "/usr/local/venv/MG5_aMC/madgraph/interface/reweight_interface.py", line 507, in do_launch
self.load_module()
File "/usr/local/venv/MG5_aMC/madgraph/interface/reweight_interface.py", line 1901, in load_module
all_prefix = [''.join([i.decode(errors='ignore') for i in j]).strip().lower() for j in mymod.get_prefix()]
File "/usr/local/venv/MG5_aMC/madgraph/interface/reweight_interface.py", line 1901, in <listcomp>
all_prefix = [''.join([i.decode(errors='ignore') for i in j]).strip().lower() for j in mymod.get_prefix()]
File "/usr/local/venv/MG5_aMC/madgraph/interface/reweight_interface.py", line 1901, in <listcomp>
all_prefix = [''.join([i.decode(errors='ignore') for i in j]).strip().lower() for j in mymod.get_prefix()]
AttributeError: 'int' object has no attribute 'decode'
```
After adding a printout, I see that `mymod` is `rwgt/rw_me/SubProcesses/allmatrix3py.py` inside the process directory.
The issue seems to be some environment-dependent change in numpy type for the return value of `mymod.get_prefix()`, it is in my enviornment:
```
root@aa2494a3bde8:~/data/uuhuu# python3 -i rwgt/rw_me/SubProcesses/allmatrix3py.py
>>> get_prefix()
array([b'M0_ '], dtype='|S20')
```
whereas in a working environment it is
```
array([[b'M', b'0', b'_', b' ', b' ', b' ', b' ', b' ', b' ', b' ', b' ',
b' ', b' ', b' ', b' ', b' ', b' ', b' ', b' ', b' ']],
dtype='|S1')
```
Changing the line to
```
all_prefix = [bytes(j).decode(errors="ignore").strip().lower() for j in get_prefix()]
```
seems to allow both types to be processed. Does this make sense?
When trying to run a reweighting of a SMEFTsim model in v3.4.2, I get the error topU3l_ MwScheme_ UFO. Loading... /bugs.launchpad .net/mg5amcnlo data/uuhuu/ run_01_ tag_1_debug. log'.
```
reweight -from_cards
INFO: Extracting the banner ...
INFO: process: u u~ > h u u~ NP<=1
INFO: options: SMHLOOP=0
INFO: Running Reweighting
change rwgt_dir rwgt
launch --rwgt_name=rw_sm
INFO: detected model: SMEFTsim_
CRITICAL: Model with non QCD emission of gluon (found 14 of those).
This type of model is not fully supported within MG5aMC.
Restriction on LO dynamical scale and MLM matching/merging can occur for some processes.
Use such features with care.
CRITICAL: Model with non QCD emission of gluon (found 14 of those).
This type of model is not fully supported within MG5aMC.
Restriction on LO dynamical scale and MLM matching/merging can occur for some processes.
Use such features with care.
INFO: generating the square matrix element for reweighting
INFO: generate u u~ > h u u~ NP<=1 SMHLOOP=0 ;
INFO: Done 12.39
Command "launch" interrupted with error:
AttributeError : 'int' object has no attribute 'decode'
Please report this bug on https:/
More information is found in '/root/
Please attach this file to your report.
```
Looking at run_01_ tag_1_debug. log I see the following traceback: data/uuhuu/ bin/internal/ extended_ cmd.py" , line 1544, in onecmd orig(line, **opt) data/uuhuu/ bin/internal/ extended_ cmd.py" , line 1493, in onecmd_orig data/uuhuu/ bin/internal/ madevent_ interface. py", line 2763, in do_launch do_generate_ events( line, *args, **opt) data/uuhuu/ bin/internal/ madevent_ interface. py", line 2404, in do_generate_events run_generate_ events( switch_ mode, args) data/uuhuu/ bin/internal/ common_ run_interface. py", line 7634, in new_fct fct(obj, *args, **opts) data/uuhuu/ bin/internal/ madevent_ interface. py", line 2657, in run_generate_events exec_cmd( 'reweight -from_cards', postcmd=False) data/uuhuu/ bin/internal/ extended_ cmd.py" , line 1573, in exec_cmd orig(current_ interface, line, **opt) data/uuhuu/ bin/internal/ extended_ cmd.py" , line 1493, in onecmd_orig data/uuhuu/ bin/internal/ common_ run_interface. py", line 2238, in do_reweight cmd.import_ command_ file(path) venv/MG5_ aMC/madgraph/ interface/ extended_ cmd.py" , line 1692, in import_command_file exec_cmd( line, precmd=True) venv/MG5_ aMC/madgraph/ interface/ extended_ cmd.py" , line 1573, in exec_cmd orig(current_ interface, line, **opt) venv/MG5_ aMC/madgraph/ interface/ extended_ cmd.py" , line 1493, in onecmd_orig venv/MG5_ aMC/madgraph/ various/ misc.py" , line 111, in f_with_no_logger venv/MG5_ aMC/madgraph/ interface/ reweight_ interface. py", line 507, in do_launch load_module( ) venv/MG5_ aMC/madgraph/ interface/ reweight_ interface. py", line 1901, in load_module [i.decode( errors= 'ignore' ) for i in j]).strip().lower() for j in mymod.get_prefix()] venv/MG5_ aMC/madgraph/ interface/ reweight_ interface. py", line 1901, in <listcomp> [i.decode( errors= 'ignore' ) for i in j]).strip().lower() for j in mymod.get_prefix()] venv/MG5_ aMC/madgraph/ interface/ reweight_ interface. py", line 1901, in <listcomp> [i.decode( errors= 'ignore' ) for i in j]).strip().lower() for j in mymod.get_prefix()]
```
Traceback (most recent call last):
File "/root/
return self.onecmd_
File "/root/
return func(arg, **opt)
File "/root/
self.
File "/root/
self.
File "/root/
original_
File "/root/
self.
File "/root/
stop = Cmd.onecmd_
File "/root/
return func(arg, **opt)
File "/root/
reweight_
File "/usr/local/
self.
File "/usr/local/
stop = Cmd.onecmd_
File "/usr/local/
return func(arg, **opt)
File "/usr/local/
out = f(self, *args, **opt)
File "/usr/local/
self.
File "/usr/local/
all_prefix = [''.join(
File "/usr/local/
all_prefix = [''.join(
File "/usr/local/
all_prefix = [''.join(
AttributeError: 'int' object has no attribute 'decode'
```
After adding a printout, I see that `mymod` is `rwgt/rw_ me/SubProcesses /allmatrix3py. py` inside the process directory. dependent change in numpy type for the return value of `mymod. get_prefix( )`, it is in my enviornment: e8:~/data/ uuhuu# python3 -i rwgt/rw_ me/SubProcesses /allmatrix3py. py j).decode( errors= "ignore" ).strip( ).lower( ) for j in get_prefix()]
The issue seems to be some environment-
```
root@aa2494a3bd
>>> get_prefix()
array([b'M0_ '], dtype='|S20')
```
whereas in a working environment it is
```
array([[b'M', b'0', b'_', b' ', b' ', b' ', b' ', b' ', b' ', b' ', b' ',
b' ', b' ', b' ', b' ', b' ', b' ', b' ', b' ', b' ']],
dtype='|S1')
```
Changing the line to
```
all_prefix = [bytes(
```
seems to allow both types to be processed. Does this make sense?