GreenDelta / olca-ipc.py

Mozilla Public License 2.0
29 stars 17 forks source link

Opening IPC Server from Python #2

Open ghost opened 5 years ago

ghost commented 5 years ago

Is there a way to start the IPC Server in OpenLCA without using the GUI but from a python console?

Thanks so much!

clementbrizard commented 4 years ago

@msrocka any update on this topic ?

msrocka commented 4 years ago

The IPC server package has a Main class so yes you can start it without the GUI. Also, openLCA comes with an embedded Java runtime so you could run the following script in the openLCA installation folder in Windows to start the IPC server:

rem the path to the database
set db=C:\Users\ms\openLCA-data-1.4\databases\ecoinvent_2_2_unit

rem the Java executable
set java_exec=.\jre\bin\java.exe

rem the installation folders with the openLCA modules
set cp=.\plugins\olca-app_1.10.2\libs\*

%java_exec% -cp %cp% org.openlca.ipc.Main -port 8080 -db %db%

(for Linux and macOS it would be equivalent). You can execute these commands of course also from Python using the process API. However, it is currently not possible to load the native calculation libraries via this startup command, so calculation would be slow... but the rest should work.

R-Hammer commented 2 years ago

Are they any new updates on this to use the calculations? I would like to run all of this on a linux server with out a GUI.