brightway-lca / bw_recipe_2016

ReCiPe 2016 LCIA method for Brightway
BSD 3-Clause "New" or "Revised" License
4 stars 4 forks source link

TypeError: object of type 'NoneType' has no len( #11

Open AJue3101 opened 2 years ago

AJue3101 commented 2 years ago

Hi Everyone,

i get this error running add_recipe_2016()

Adding OzoneFormationEcosystems Adding HumanCarcinogenicToxicity Adding LandOccupation Adding FreshwaterEutrophication Adding MarineEutrophication Adding OzoneFormationHumans Adding LandTransformation

TypeError Traceback (most recent call last) Input In [7], in ----> 1 add_recipe_2016()

File ~\miniconda3\envs\MENA-Fuels\lib\site-packages\bw_recipe_2016__init.py:112, in add_recipe_2016(version) 110 print("Adding {}".format(c.name__)) 111 category = c(data[i], biosphere, version) --> 112 category.apply_strategies(verbose=False) 113 try: 114 category.drop_unlinked(verbose=False)

File ~\miniconda3\envs\MENA-Fuels\lib\site-packages\bw2io\importers\base.py:69, in ImportBase.apply_strategies(self, strategies, verbose) 67 total = len(func_list) 68 for i, func in enumerate(func_list): ---> 69 self.apply_strategy(func, verbose) 70 if hasattr(self, "signal") and hasattr(self.signal, "emit"): 71 self.signal.emit(i + 1, total)

File ~\miniconda3\envs\MENA-Fuels\lib\site-packages\bw2io\importers\base.py:48, in ImportBase.apply_strategy(self, strategy, verbose) 46 print("Applying strategy: {}".format(func_name)) 47 try: ---> 48 self.data = strategy(self.data) 49 self.applied_strategies.append(func_name) 50 except StrategyError as err:

File ~\miniconda3\envs\MENA-Fuels\lib\site-packages\bw_recipe_2016\strategies\matching.py:81, in match_multiple(data, other) 78 if cf["name"].lower() in other_dict: 79 to_remove.append(cf) 80 to_add.extend( ---> 81 [ 82 add_flow(deepcopy(cf), ds) 83 for ds in other_dict[cf["name"].lower()] 84 if category_match(ds, cf) 85 ] 86 ) 87 else: 88 for synonym in cf.get("synonyms", []):

File ~\miniconda3\envs\MENA-Fuels\lib\site-packages\bw_recipe_2016\strategies\matching.py:84, in (.0) 78 if cf["name"].lower() in other_dict: 79 to_remove.append(cf) 80 to_add.extend( 81 [ 82 add_flow(deepcopy(cf), ds) 83 for ds in other_dict[cf["name"].lower()] ---> 84 if category_match(ds, cf) 85 ] 86 ) 87 else: 88 for synonym in cf.get("synonyms", []):

File ~\miniconda3\envs\MENA-Fuels\lib\site-packages\bw_recipe_2016\strategies\matching.py:42, in category_match(a, b) 38 def category_match(a, b): 39 """Return bool, whether the starting categories in a match the categories in b. 40 41 For example, category_match({'categories': ('foo',)}, {"categories": ('foo', 'bar')}) is true.""" ---> 42 return tuple(a["categories"][: len(b["categories"])]) == tuple(b["categories"])

TypeError: object of type 'NoneType' has no len()