-
-
Notifications
You must be signed in to change notification settings - Fork 118
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
Fix validation test_fbp_ferc1_mismatched_fuels
error
#3025
Conversation
This is disconcerting. Previously the ID assignment process was expecting empty strings in there. Rather than turning the mysterious "nan” strings into |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the code snipped you cite as the source of the "nan" values, how are they getting there?
for fuel_str in fuel_categories:
try:
mmbtu_mask = df2[f"{fuel_str}_fraction_mmbtu"] > thresh
df2.loc[mmbtu_mask, "primary_fuel_by_mmbtu"] = fuel_str
except KeyError:
pass
try:
cost_mask = df2[f"{fuel_str}_fraction_cost"] > thresh
df2.loc[cost_mask, "primary_fuel_by_cost"] = fuel_str
except KeyError:
pass
Is it that "nan" is somehow showing up the fuel_categories
? That doesn't seem right, since it's just the keys of the pudl.transform.params.ferc1.FUEL_CATEGORIES["categories"]
dictionary.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev #3025 +/- ##
=====================================
Coverage 88.7% 88.7%
=====================================
Files 91 91
Lines 11010 11011 +1
=====================================
+ Hits 9768 9769 +1
Misses 1242 1242
☔ View full report in Codecov by Sentry. |
no, the fuel cats have a specific |
PR Overview
We were getting the following error:
I determined that this was happening bc the nulls in the fuel table were somehow getting converted to
"nan"
:first solution:
A part of the
pudl.analysis.classify_plants_ferc1.fuel_by_plant_ferc1
step does convert nulls to""
and there is a post-processing step that we were already applying (pudl.analysis.classify_plants_ferc1.revert_filled_in_string_nulls
). I simply added"nan"
in here.Still tbh do no know why these
"nan"
s were all of a sudden appearing but hey.. they are gone now 👀current solution:
it looooks as if the "nan" is added in right here...
So I stopped em in their tracks 🚥 . these columns don't exist before this loop and not all of the records get labeled with a
fuel_str
bc not all of the records meet thethresh
so I added the whole column before the loop w/ values ofpd.NA
PR Checklist
dev
).