2

As a prophecy, I have a question related to a previous question of "cleaning" the database. How can I identify why my technosphere is not longer square?

I have done something to my database that if I try to do an LCIA of a random activity

def testactivity(activity):
    method_key=methods.random()
    fu={activity:1}
    lca = LCA(fu,method_key)
    lca.lci()
    lca.lcia()
    print(lca.score)
    return()

    testactivity(Database('ei_33consequential').random())

I get this warning message: NonsquareTechnosphere: Technosphere matrix is not square: 12384 activities (columns) and 12385 products (rows). Use LeastSquaresLCA to solve this system, or fix the input data.

I tried to find if I have a dataset with two reference products, to check that I looped through the database to check if the "production amount" was not a float. but I didn't find anything "wrong"

for ds in Database('ei_33consequential'):
    if (isinstance(act['production amount'],float))==False:
        print(ds['name'])

Is this approach correct to find an activity with more than one reference flow?. Otherwise, how can I find the product which is making my matrix non inversable?

Community
  • 1
  • 1
Nabla
  • 1,509
  • 3
  • 20
  • 35

1 Answers1

1

You can check to see which activities have more than one production exchange with something like this:

for a in Database("ecoinvent 3.3 cutoff"):
    assert len(a.production()) == 1
Chris Mutel
  • 2,549
  • 1
  • 14
  • 9
  • Thanks!, although I did not find any activity with more than one reference product. Is there a way to check if a production exchange in the database is not produced by any activity? – Nabla Apr 20 '17 at 02:41