Closed froborg closed 2 years ago
The following answer received, thanks Chris!
The specific issue you are having is due to the presence of a flow in your 'biosphere3' database which doesn't have the 'categories' attribute. You can fix this by relaxing this assumption:
[act for act in db if 'Ammonia' in act['name'] and 'non-urban air' in str(act.get('categories'))]
You could also find the offending flow(s) with:
[flow for flow in db if not flow.get('categories')]
Hi all
I try to include some biosphere flows into my LCA but have some issues with Activities whose name is only one word. Not sure if that is only a coincidence or correlation though... Here what I am doing (using Jupyter & Python 3.8):
I have established, that the flow exists:
bw2.Database('biosphere3').search('Ammonia', filter={'categories':'air'})
And the above code works with e.g. Carbon dioxide:
[act for act in db if 'Carbon dioxide' in act['name'] and 'non-urban air' in str(act['categories'])]
The search worked nicely also for dinitrogen monoxide and nitrogen oxides but resulted in the same error for Phosphorus and Phosphate. Am I missing something?