USEPA / ElectricityLCI

Creative Commons Zero v1.0 Universal
24 stars 10 forks source link

Errors in running code with latest as well as v 1.0.1 of eLCI #154

Closed tjlca closed 3 years ago

tjlca commented 3 years ago

Hi @jump2conclusionsmatt , I tried to run the latest version of the eLCI ( as well v 1.0.1) along with latest version ( as well as v 0.95) of STEWI. Everytime I am getting this error. Is this a issue with some package that I am using?

  File "/Users/tghosh/OneDrive - NREL/electricityLCI/project/electricitylci/main.py", line 147, in <module>
    main()

  File "/Users/tghosh/OneDrive - NREL/electricityLCI/project/electricitylci/main.py", line 23, in main
    upstream_df = electricitylci.get_upstream_process_df(config.model_specs.eia_gen_year)

  File "/Users/tghosh/OneDrive - NREL/electricityLCI/project/electricitylci/__init__.py", line 297, in get_upstream_process_df
    from electricitylci.combinator import concat_map_upstream_databases

  File "/Users/tghosh/OneDrive - NREL/electricityLCI/project/electricitylci/combinator.py", line 4, in <module>
    import electricitylci.generation as gen

  File "/Users/tghosh/OneDrive - NREL/electricityLCI/project/electricitylci/generation.py", line 19, in <module>
    from electricitylci.egrid_facilities import egrid_facilities

  File "/Users/tghosh/OneDrive - NREL/electricityLCI/project/electricitylci/egrid_facilities.py", line 47, in <module>
    egrid_facilities_fuel_cat_per_gen = egrid_facilities[cols_to_keep]

  File "/Users/tghosh/opt/anaconda3/lib/python3.7/site-packages/pandas/core/frame.py", line 2806, in __getitem__
    indexer = self.loc._get_listlike_indexer(key, axis=1, raise_missing=True)[1]

  File "/Users/tghosh/opt/anaconda3/lib/python3.7/site-packages/pandas/core/indexing.py", line 1552, in _get_listlike_indexer
    keyarr, indexer, o._get_axis_number(axis), raise_missing=raise_missing

  File "/Users/tghosh/opt/anaconda3/lib/python3.7/site-packages/pandas/core/indexing.py", line 1645, in _validate_read_indexer
    raise KeyError(f"{not_found} not in index")

KeyError: "['Plant  hydro generation percent (resource mix)'] not in index"
tjlca commented 3 years ago

I was able to trace the error to using Stewi and stewi combo v0.95. The version 0.95 of STEWI and STEWI combo does not work with the elCI version master as well as eLCI version 1.0.1. For the paper that I am writing this does not cause too many problems but I will be listing some bugs that may be related to this issue.

bl-young commented 3 years ago

The current release of eLCI (1.0.1) is still tied to a slightly earlier version of StEWI 0.9.3. https://github.com/USEPA/ElectricityLCI/blob/v1.0.1/setup.py#L15

A typo in the eGRID data which has been fixed in later versions of stewi (such as 0.9.5) requires an associated change in eLCI. The next version of eLCI will work with StEWI 0.9.5 and later.

tjlca commented 3 years ago

@bl-young Thanks for the explanation Ben. I will close this issue.