singularity-energy / open-grid-emissions

Tools for producing high-quality hourly generation and emissions data for U.S. electric grids
MIT License
72 stars 5 forks source link

Fill missing generated rates #290

Closed grgmiller closed 1 year ago

grgmiller commented 1 year ago

When outputting power sector data with consumed rates using the new warnings, the warnings caught that there were some missing generated rates in the outputs. After looking into this, it looks like this was happening because we were implementing .fillna(0) before we replaced inf values with na.

This PR moves the fillna after the inf replacement, and also explicitly only fills na values that were a result of net_generation_mwh (the denominator in the generated rate calculation) being zero. This means that the expected behavior should be: