spatial-data-lab / knime-geospatial-extension

This repository is built for KNIME-CGA Geospatial Project, and the goal is to build Python-based nodes for geospatial analysis in KNIME Analytic Platform.
MIT License
20 stars 8 forks source link

Location Analysis nodes e.g. p-median solver fail on macOS and Linux #98

Open ddelano34 opened 1 year ago

ddelano34 commented 1 year ago

I am trying to run the Geospatial Allocation based on Vaccine Distribution example and the P-Median node fails to execute and returns an error with the solver. I installed the Geospatial Analytics Extension for KNIME using the extensions installation interface and did not see any other setup instructions to use this extension.

Versions: macOS Ventura 13.0.1, M1 Pro Knime 4.7.0 Geospatial Analytics Extension for KNIME 1.0.0.202212100353 KNIME Geospatial Extension 4.7.0.v202211290844

Example workflow link: https://hub.knime.com/-/spaces/-/latest/~OBf4SG6G-00Hhwr1/

Stack Trace: `WARN P-median 3:85 Traceback (most recent call last): File "/Applications/KNIME 4.7.0.app/Contents/Eclipse/plugins/org.knime.python3.nodes_4.7.0.v202211291148/src/main/python/_node_backend_launcher.py", line 459, in execute outputs = self._node.execute(exec_context, *inputs) File "/Applications/KNIME 4.7.0.app/Contents/Eclipse/plugins/sdl.harvard.geospatial_1.0.0.202212100353/src/main/python/src/nodes/locationanalysis.py", line 203, in execute problem.solve() File "/Applications/KNIME 4.7.0.app/Contents/Eclipse/plugins/sdl.harvard.geospatial.channel.bin.macosx.aarch64_1.0.0.202212100353/env/lib/python3.9/site-packages/pulp/pulp.py", line 1913, in solve status = solver.actualSolve(self, **kwargs) AttributeError: 'NoneType' object has no attribute 'actualSolve'

ERROR P-median 3:85 Execute failed: 'NoneType' object has no attribute 'actualSolve'`

UrbanGISer commented 1 year ago

Thanks for sharing the issues here. From the error report, 'NoneType' object has no attribute 'actualSolve' it seems that the parameters might have some issues, leading to an empty quest. Can you post your screenshot of the configuration dialog of P-median. Thanks

ddelano34 commented 1 year ago

Here is the configuration dialog with the setup in the sample project.

Screenshot 2023-01-04 at 9 00 31 PM
UrbanGISer commented 1 year ago

@ ddelano34 thanks for providing the input parameters! As it is the original parameter, the issue is not related to the node itself, but might relate to the working platform. I just tested that workflow in the Windows platform, and the workflow worked fine. It did do not work on a laptop with the macOS M1 platform. I will ask my colleagues to further explore that.

koettert commented 1 year ago

@UrbanGISer it seems that the PuLP library does not have all functionality on all OSes especially for MacOS (M1 and Intel). Can you please check if there is a version of PuLP that is fully supported by all OSes or can check if we can use an alternative library to solve the problem.

koettert commented 1 year ago

Just run the testflows on Linux and the p-median solver as well as the LSCP and MCLP fail with the above mentioned exception.