Comment 0 for bug 1698157

Revision history for this message
Sho Iwamoto (misho) wrote :

Hi MadTeam, On MG5_aMC v2.5.5, importing a model in the current directory may raise ImportError.

Assume I have a model at `~/newmodel/` and executing MG5_aMC from home directory. Then both of `import model ~/newmodel` and `import model ./newmodel` do work, but `import model newmodel` does not work.

This is because `find_ufo_path` in `import_ufo.py` accepts last option (line 80) but `models/__init__.py` assumes that `model_name` without `/` is located on `MG5DIR/models` and then line 30 raises ImportError.

I am not sure which is the expected feature: 1) all the models outside `MG5DIR/models` should be called with an absolute or relative path (i.e., must be specified with at least one `os.sep`), or 2) ["MG5DIR/models", ".", $PYTHONPATH] are equally treated and `import model newmodel` should be interpreted as `import model ./newmodel`. If (1), then it would be nice if ImportError exception is caught and a better error message is provided.