0 votes

It seems that when I set up a product system in openLCA and calculate it, everything is fine. If I calculate the same product system from python (the one from Developer Tools, not the IPC), sometimes it corrupts something inside the system and I get empty or 0 results. When I calculate in openLCA again, I get negative process inventories as well as "�" (replacement character) in the contribution tree. All I do in python is change a global parameter and calculate.

After reconnecting all flows, I get this error:

javax.persistence.RollbackException: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.7.3.v20180807-4be1041): org.eclipse.persistence.exceptions.DatabaseException
    Internal Exception: java.sql.SQLDataException: The resulting value is outside the range for the data type DOUBLE.
    Error Code: 20000
    Call: INSERT INTO tbl_exchanges (id, resulting_amount_value, resulting_amount_formula, base_uncertainty, cost_formula, cost_value, f_default_provider, description, dq_entry, internal_id, avoided_product, is_input, distribution_type, parameter1_formula, parameter2_formula, parameter3_formula, parameter1_value, parameter2_value, parameter3_value, f_currency, f_flow, f_flow_property_factor, f_unit) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
     bind => [23 parameters bound]
    Query: InsertObjectQuery(Exchange [flow=RootEntity [type=Flow, refId=714958de-a211-4a3c-8dce-848ccb79b094, name=Tungsten], input=false,amount=NaN, unit=Unit [id=1056, name=kg]])

Any ideas where that could come from? It seems like something converted some values to NaN?

in openLCA by (420 points)
edited by

1 Answer

0 votes
by (80.9k points)
selected by
Best answer

Hi, it could be that you connect the life cycle differently via python (so e.g., not only providers, etc.), and thus obtain a system that does not make sense, e.g. that has loops that do not converge.

The resulting value is outside the range for the data type DOUBLE

in your log snippet indicates this somehwat. Or of course the parameter value change leads to a system that cannot be calculated. Maybe you could post the code and some more details (which database, how did you build the product system via the user interface) - thank you.

by (420 points)
Hi, maybe that isn't a python error, as I also had corrupted systems without using python. Python doesn't modify the product system in any way, it just sets some global parameters, calculates and saves the results.

If I create a new product system and connect everything manually and then calculate, it works.

It may have to do with building the product system, but there is a random part to it. If I use the auto-complete, it happens more often than when I manually connect the upstream processes. It might also have to do with the fact that I use product systems in the upstream?

So the steps I did when it last happened:
* Create a new product system from a process with auto-connect and prefer system processes (ecoInvent 3.7.1)
* delete some of the upstream processes and replace them with product systems
* calculate (with python or in openLCA)

To sum up: you are probably right and the way I connect the processes might be the culprit.