Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No 2022 EIA transmission and distribution loss data #235

Open
dt-woods opened this issue Mar 11, 2024 · 3 comments
Open

No 2022 EIA transmission and distribution loss data #235

dt-woods opened this issue Mar 11, 2024 · 3 comments
Labels
bug in v2 Issues marked for inclusion in version 2

Comments

@dt-woods
Copy link
Collaborator

The state-based archive data used for T&D calculation comes from EIA (see here) and, as of writing, historical data are available up to 2021.

The eia_gen_year modelconfig is used to pull the T&D loss data and is currently failing for 2022 baseline.

@dt-woods
Copy link
Collaborator Author

A possible work-around is to use 2021 T&D losses for 2022 by implementing a if-else for 2022 gen years found in get_distribution_mix_df:

def get_distribution_mix_df(combined_df, subregion=None):

@dt-woods
Copy link
Collaborator Author

I guess the problem isn't that 2022 data isn't available. The problem is that the archive URL now redirects rather than fails.

The 2022 URL is the url_b.

@dt-woods
Copy link
Collaborator Author

Implementing secondary check against requests' headers:

r = requests.get(url_a)
r_head = r.headers.get("Content-Type", "")
if not r.ok or r_head.startswith("text"):
    logging.info(f"Trying alternative site {STATE_ABBREV[key]}")
    r = requests.get(url_b)

dt-woods added a commit to KeyLogicLCA/ElectricityLCI that referenced this issue Mar 11, 2024
@dt-woods dt-woods added bug in v2 Issues marked for inclusion in version 2 labels Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug in v2 Issues marked for inclusion in version 2
Projects
None yet
Development

No branches or pull requests

1 participant