Closed aleksandra-kim closed 8 years ago
Original report by Chris Mutel (Bitbucket: cmutel, GitHub: cmutel).
#!python In [47]: lca = LCA({elec: 1}) In [48]: lca.lci(factorize=True) In [49]: lca.lci(factorize=True) --------------------------------------------------------------------------- KeyError Traceback (most recent call last) <ipython-input-49-81d0786914c4> in <module>() ----> 1 lca.lci(factorize=True) /Users/cmutel/local35/bw3/lib/python3.5/site-packages/bw2calc/lca.py in lci(self, factorize, builder) 254 """ 255 self.load_lci_data(builder) --> 256 self.build_demand_array() 257 if factorize: 258 self.decompose_technosphere() /Users/cmutel/local35/bw3/lib/python3.5/site-packages/bw2calc/lca.py in build_demand_array(self, demand) 88 for key in demand: 89 try: ---> 90 self.demand_array[self.product_dict[key]] = demand[key] 91 except KeyError: 92 if key in self.activity_dict: KeyError: 'electricity, low voltage, production CH, at grid' (kilowatt hour, CH, ['electricity', 'production mix'])
Something about fixing dictionaries and then reloading them...
Original comment by Chris Mutel (Bitbucket: cmutel, GitHub: cmutel).
Fixed in https://bitbucket.org/cmutel/brightway2-calc/commits/76e5231d44792cb53bd9531ada5d1b0fd139ec43
Original report by Chris Mutel (Bitbucket: cmutel, GitHub: cmutel).
Something about fixing dictionaries and then reloading them...