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 ICD materials, suppress multiple FutureWarnings #73

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ It pulls data from a Google Sheet (facility ids, used oil collection center [UOC

It is designed to run weekly as a Google Cloud Function.

### Renaming Recycled/Composted Categories

Some material names in the recycled/composted reports are abbreviated in the salesforce data. These (along with any other material names) can be renamed as part of the great renaming chain in the end of `yearly.rates_per_material()`.

## Validation Script

The validation script compares year-over-year changes for different metrics at the facility, county, and state levels to help WMRC staff identify potential typos, missing information, or other problems with the data.
Expand Down
4 changes: 4 additions & 0 deletions src/wmrc/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import json
import logging
import sys
import warnings
from datetime import date, datetime
from pathlib import Path
from tempfile import TemporaryDirectory
Expand Down Expand Up @@ -34,6 +35,9 @@
import version
import yearly

#: The reprojection of the county geometries in Skid._update_facilities() is throwing a bunch of FutureWarnings that
#: gum up logs. Adding this to the module so that any FutureWarnings are only shown once.
warnings.simplefilter(action="once", category=FutureWarning)

class Skid:
def __init__(self):
Expand Down
1 change: 1 addition & 0 deletions src/wmrc/yearly.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ def rates_per_material(year_df: pd.DataFrame, classification: str, fields: list[
.str.replace(" CM", " Compostable Material")
.str.replace("SW Stream", "Other Solid Waste Stream Materials")
.str.replace("Paper", "Paper and Paperboard")
.str.replace("ICD", "Industrial, Commercial, and Demolition Materials")
)

return sum_df
Expand Down
Loading