brightway
find a product that causes a non-square technosphere matrix with Brightway2
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?
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
Related Links
find a product that causes a non-square technosphere matrix with Brightway2
How to make exact search in Database
Find all processes emitting a certain biosphere flow in LCA
Get method tuple from abbreviation in Brightway2
Connecting exchange names and codes to LCA inventory results
copy projects between different computers
importing ecoinvent 3.2 with brightway
Brightway2: Modifying/deleting exchanges from activity without using activity as dict
Backups in Brightway: how to use them
Saving multiple activities to database in a loop in Brightway
Obtaining distribution of results from LCIA
Simapro dataset to ecoinvent migration fails in brightway2
What is the best practice when importing 2 simapro datasets in brightway2 to merge them together
How to manually link in Brightway2 an imported exchange, given I have found the correct one in ecoinvent
Can't write copy of activity in newly created databases
Are eco-indicator endpoints reported in points or millipoints