TissueMAPS / JtLibrary

Please use the https://github.com/TissueMAPS/TissueMAPS instead.
Apache License 2.0
0 stars 2 forks source link

Plotting is broken in current develop due to import error #25

Closed jluethi closed 6 years ago

jluethi commented 6 years ago

Whenever plotting is set to True in a module in the current develop branch (14db3a8083f877b437151af2020c2f68b7cf5575), the pipeline fails because of the following import error: JOB FAILED: cannot import name plotting File "/home/tissuemaps/tmlibrary/tmlib/workflow/cli.py", line 283, in __main__ cli_instance(arguments) File "/home/tissuemaps/tmlibrary/tmlib/workflow/cli.py", line 342, in __call__ method(**method_args) File "/home/tissuemaps/tmlibrary/tmlib/workflow/jterator/cli.py", line 102, in debug api.run_job(batch, assume_clean_state=False) File "/home/tissuemaps/tmlibrary/tmlib/workflow/jterator/api.py", line 679, in run_job store = self._run_pipeline(store, site_id, batch['plot']) File "/home/tissuemaps/tmlibrary/tmlib/workflow/jterator/api.py", line 363, in _run_pipeline module.run(self._engines[module.language]) File "/home/tissuemaps/tmlibrary/tmlib/workflow/jterator/module.py", line 470, in run return self._exec_py_module() File "/home/tissuemaps/tmlibrary/tmlib/workflow/jterator/module.py", line 196, in _exec_py_module py_out = func(**kwargs) File "/home/tissuemaps/jtlibrary/python/jtmodules/src/jtmodules/smooth.py", line 85, in main from jtlib import plotting

The "from jtlib import plotting" doesn't work anymore because of the refactor that reorganized the modules & jtlibrary code. @riccardomurri How can one import the plotting file which is located at "JtLibrary/python/jtlibrary/src/jtlib/"? This import needs to be changed for all modules that use plotting.

jluethi commented 6 years ago

Actually, that problem seems to happen broader. e.g. the filter.py module fails with: File "/home/tissuemaps/jtlibrary/python/jtmodules/src/jtmodules/filter.py", line 21, in <module> from jtlib.features import Morphology, create_feature_image

jluethi commented 6 years ago

Turns out this is an issue when switching between the current master & develop and not properly reinstalling jtlib. Because the structure of the files changed, it can't find the necessary functions anymore. This can be solved by reinstalling them correctly:

pip install --user -e ~/jtlibrary/python/jtlibrary/
pip install --user -e ~/jtlibrary/python/jtmodules/

Thanks @riccardomurri for helping me here! You can close this issue.

riccardomurri commented 6 years ago

All is well that ends well :-)