-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error when running olca_schema.calculate
using a stand-alone server
#61
Comments
Mmh, this is just a debug log message, not an error message and not a message regarding the calculation. Without more details (server setup, native libraries loaded or not, database, what does not work) it is hard to say something. |
Hi @msrocka. Thank you for your response and sorry for the delay. I am starting the server running the following line in my terminal .\ipc-server.cmd ecoinvent_v3_10_Consequential_Unit_Processes_2024_01_22_rodolpho After that, I run something similar the example below (which runs into the same problem). It never prints the import olca_ipc
import olca_schema
client = olca_ipc.Client(8080)
group = olca_schema.new_unit_group('Mass units', 'kg')
mass = olca_schema.new_flow_property('Mass', group)
client.put_all(group, mass)
concrete = client.get(olca_schema.Flow, 'ef5d9b7f-0d4a-49b9-a2eb-eef36ded1c38')
steel = client.get(olca_schema.Flow, '0c826417-e870-4c43-95c4-b38ff2ff47d2')
output_product = olca_schema.new_product("MyProduct", mass)
client.put(output_product)
process = olca_schema.new_process("MyProcess")
exchange = olca_schema.new_input(process, concrete, 10)
exchange.is_quantitative_reference = True
exchange = olca_schema.new_input(process, steel, 5)
exchange.is_quantitative_reference = True
exchange = olca_schema.new_output(process, output_product, 1)
exchange.is_quantitative_reference = True
created_process = client.put(process)
product_system = client.create_product_system(created_process)
method = client.get_descriptors(olca_schema.ImpactMethod)[0]
calculationSetup = olca_schema.CalculationSetup(
target = product_system,
impact_method = method,
)
print("Start calculation")
result = client.calculate(calculationSetup)
result.wait_until_ready()
print("Finished!")
impacts = result.get_total_impacts() |
Hi @msrocka ! I was wondering if you had time to look at my example. Thanks! |
The script works for me (but it should not create mass and a unit group but should instead get it from the database like it is done for the linked products). What is missing currently in the server startup script is the loading of the calculation libraries, the calculation then takes quite some time. The
|
Hi @msrocka ! Thank you so much for your response. I understand that I have to point the calculation libraries folder. But I am having trouble to find it. Shouldn't it be inside the database? I am getting confused because when I open the database with OpenLCA, there is a folder (that seems to be inside the database) with the methods. However, when I double click on the database, this is what I see |
Also, if it is not too much trouble, could you send me a command example (with all the necessary parameters) that I should run in order for my code to work? |
Greetings,
You have already helped me with stalling
olca-modules
, but now I am having trouble when runningolca_schema.calculate
.I managed to launch a stand-alone server and add some processes to the database. Now I would like to run a calculation but I keep getting this error in the terminal
Am I doing something wrong?
I have already tested this code using the server launched from OpenLCA interface and it worked.
Thanks in advance 🙂
The text was updated successfully, but these errors were encountered: