Missleading module import paths in docs
There are inconsistencies in how the modules of the middleware should be imported.
For example, in the instructions to Create a WFEngine object, the docs show:
from wfengine import WFEngine
wfe = WFEngine(launchpad=launchpad, wf_query=wf_query)
If the example is followed, then the jupyter or ipython session will print an error message complaining about a non-found module:
from wfquery import WFQuery
wfq = WFQuery(lpad, wf_query={}, fw_query={'fw_id': 115})
print(wfq.get_fw_info())
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
Cell In[1], line 1
----> 1 from wfquery import WFQuery
2 wfq = WFQuery(lpad, wf_query={}, fw_query={'fw_id': 115})
3 print(wfq.get_fw_info())
ModuleNotFoundError: No module named 'wfquery'
No modules from the vre-middleware package can be loaded like this.
The actual way to load the modules is shown in a non-obvious section of the docs, namely the Development installation:
After installing the packages, the modules from VRE Middleware can be loaded, for example
from virtmat_vre.middleware.query.wfquery import WFQuery
Still this information is incomplete, as the right import path should be, for example:
from virtmat.middleware.query.wfquery import WFQuery
I guess there are two solution paths:
- Change the docs som that every module import has the correct path
virtmat.middleware.module.CLASS
- Modify the package (probably
__init__.py
?) so that the short version of import works (e.g. from wfengine import WFEngine).
Edited by Rodrigo Cortes Mejia