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

Rename heat_rate_mmbtu_mwh -> heat_rate_mmbtu_mwh_by_unit #2917

Merged

Conversation

bendnorman
Copy link
Member

PR Overview

This PR rename the heat_rate_mmbtu_mwh -> heat_rate_mmbtu_mwh_by_unit so it's clear heat rate is a unit level attribute. We decided to make this change because assets downstream of _out_eia__{freq}_heat_rate_by_unit broadcast heat_rate_mmbtu_mwh across generators.

@katie-lamb I replaced all instances of heat_rate_mmbtu_mwh with heat_rate_mmbtu_mwh_by_unit. Are there parts of the code where it doesn't make sense to use heat_rate_mmbtu_mwh_by_unit? I think it might be a little duplicative to have a heat_rate_mmbtu_mwh_by_unit column in the heat_rate_mmbtu_mwh_by_unit asset but I thought it would be nice for the column name to be consistent / traceable throughout all of the assets.

PR Checklist

  • Merge the most recent version of the branch you are merging into (probably dev).
  • All CI checks are passing. Run tests locally to debug failures
  • Make sure you've included good docstrings.
  • For major data coverage & analysis changes, run data validation tests
  • Include unit tests for new functions and classes.
  • Defensive data quality/sanity checks in analyses & data processing functions.
  • Update the release notes and reference reference the PR and related issues.
  • Do your own explanatory review of the PR to help the reviewer understand what's going on and identify issues preemptively.

@bendnorman bendnorman requested a review from katie-lamb October 4, 2023 06:44
@codecov
Copy link

codecov bot commented Oct 4, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (799282a) 88.5% compared to head (5e5a441) 88.5%.

Additional details and impacted files
@@                   Coverage Diff                    @@
##           rename-ferc1-core-assets   #2917   +/-   ##
========================================================
  Coverage                      88.5%   88.5%           
========================================================
  Files                            90      90           
  Lines                         10821   10821           
========================================================
  Hits                           9582    9582           
  Misses                         1239    1239           
Files Coverage Δ
src/pudl/analysis/ferc1_eia.py 98.0% <ø> (ø)
src/pudl/analysis/ferc1_eia_train.py 52.9% <ø> (ø)
src/pudl/analysis/mcoe.py 97.4% <ø> (ø)
src/pudl/analysis/plant_parts_eia.py 96.5% <ø> (ø)
src/pudl/metadata/fields.py 100.0% <ø> (ø)
src/pudl/metadata/resources/eia.py 100.0% <ø> (ø)
src/pudl/metadata/resources/mcoe.py 100.0% <ø> (ø)
src/pudl/validate.py 49.4% <ø> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@zaneselvans
Copy link
Member

zaneselvans commented Oct 4, 2023

Maybe it's too late to catch this, but our convention is to have the physical units be the last component of column names.

Having _by_unit at the end also kind of clashes with the occasional _per_unit that we've used when a column has mixed units (e.g. fuel costs which can be per ton, per mcf, per gallon, per barrel) with _unit standing in for the ambiguous physical unit, whereas here the unit is a generation unit.

The physical units here are really [MMBtu / MWh] and in almost all composite unit column names we've made the per explicit as in avg_customers_per_month, min_fuel_mmbtu_per_unit, fuel_cost_per_mmbtu, fuel_cost_per_mwh etc. which I think is clearer. In the context of all those other names containing _per_ it would be easy for someone to interpret _mmbtu_mwh as units of [MMBtu * MWh]

So it seems like this column should end with _mmbtu_per_mwh, maybe like unit_heat_rate_mmbtu_per_mwh

@bendnorman
Copy link
Member Author

Ah great catch thank you @zaneselvans! I'm a total naming convention hypocrite! unit_heat_rate_mmbtu_per_mwh makes more sense, thanks for explaining. I'll update the name.

Copy link
Member

@katie-lamb katie-lamb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@jdangerx jdangerx merged commit 4260c2e into rename-ferc1-core-assets Oct 5, 2023
9 checks passed
@jdangerx jdangerx deleted the rename-heat-rate-mmbtu-mwh-column branch October 5, 2023 18:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants