Thanks for the information, actually both using "newmodel" and "./newmodel" can lead to problem.
So I'm going to change the code for
1) do not allow at all, the "newmodel" option
2) have a full support for "./newmodel"
You can find below the patch that I'm going to apply:
=== modified file 'madgraph/interface/madgraph_interface.py'
--- madgraph/interface/madgraph_interface.py 2017-04-06 21:08:27 +0000
+++ madgraph/interface/madgraph_interface.py 2017-06-15 15:18:31 +0000
@@ -5057,6 +5057,8 @@ try: self._curr_model = import_ufo.import_model(args[1], prefix=prefix, complex_mass_scheme=self.options['complex_mass_scheme'])
+ if os.path.sep in args[1] and "import" in self.history[-1]:
+ self.history[-1] = 'import model %s' % self._curr_model.get('modelpath+restriction') except import_ufo.UFOImportError, error: if 'not a valid UFO model' in str(error): logger_stderr.warning('WARNING: %s' % error)
=== modified file 'models/import_ufo.py'
--- models/import_ufo.py 2017-02-16 15:16:38 +0000
+++ models/import_ufo.py 2017-06-15 15:23:58 +0000
@@ -78,10 +78,9 @@ last_model_path = os.path.join(MG5DIR, p, model_name) return os.path.join(MG5DIR, p, model_name)
if os.path.isdir(model_name):
- if last_model_path != os.path.join(MG5DIR, model_name):
- logger.info("model loaded from: %s", os.path.join(os.getcwd(), model_name))
- last_model_path = os.path.join(MG5DIR, model_name)
- return model_name
+ logger.warning('No model %s found in default path. Did you meant \'import model ./%s\'',
+ model_name, model_name)
+ raise UFOImportError("Path %s is not a valid pathname" % model_name)
else:
raise UFOImportError("Path %s is not a valid pathname" % model_name)
Hi,
Thanks for the information, actually both using "newmodel" and "./newmodel" can lead to problem.
So I'm going to change the code for
1) do not allow at all, the "newmodel" option
2) have a full support for "./newmodel"
You can find below the patch that I'm going to apply:
=== modified file 'madgraph/ interface/ madgraph_ interface. py' interface/ madgraph_ interface. py 2017-04-06 21:08:27 +0000 interface/ madgraph_ interface. py 2017-06-15 15:18:31 +0000
try:
self._curr_ model = import_ ufo.import_ model(args[ 1], prefix=prefix,
complex_ mass_scheme= self.options[ 'complex_ mass_scheme' ]) model.get( 'modelpath+ restriction' )
except import_ ufo.UFOImportEr ror, error:
if 'not a valid UFO model' in str(error):
logger_ stderr. warning( 'WARNING: %s' % error)
--- madgraph/
+++ madgraph/
@@ -5057,6 +5057,8 @@
+ if os.path.sep in args[1] and "import" in self.history[-1]:
+ self.history[-1] = 'import model %s' % self._curr_
=== modified file 'models/ import_ ufo.py' import_ ufo.py 2017-02-16 15:16:38 +0000 import_ ufo.py 2017-06-15 15:23:58 +0000
last_model_ path = os.path. join(MG5DIR, p, model_name)
return os.path. join(MG5DIR, p, model_name) isdir(model_ name): join(MG5DIR, model_name): join(os. getcwd( ), model_name)) join(MG5DIR, model_name) "Path %s is not a valid pathname" % model_name) "Path %s is not a valid pathname" % model_name)
--- models/
+++ models/
@@ -78,10 +78,9 @@
if os.path.
- if last_model_path != os.path.
- logger.info("model loaded from: %s", os.path.
- last_model_path = os.path.
- return model_name
+ logger.warning('No model %s found in default path. Did you meant \'import model ./%s\'',
+ model_name, model_name)
+ raise UFOImportError(
else:
raise UFOImportError(