Skip to content
Open
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
45 changes: 0 additions & 45 deletions bedrock/extract/allocation/__tests__/test_bea_use_table_schema.py

This file was deleted.

151 changes: 0 additions & 151 deletions bedrock/extract/allocation/bea.py

This file was deleted.

45 changes: 0 additions & 45 deletions bedrock/extract/bea/BEA_PCE.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@
from requests import Response

from bedrock.transform.flowbyfunctions import assign_fips_location_system
from bedrock.utils.io.gcp import load_from_gcs
from bedrock.utils.io.gcp_paths import gcs_extract_input_path
from bedrock.utils.io.local_extract_input_data import local_extract_input_dir
from bedrock.utils.mapping.location import get_state_FIPS


Expand Down Expand Up @@ -102,48 +99,6 @@ def bea_pce_parse(*, df_list: list[pd.DataFrame], year: int, **_: Any) -> pd.Dat
return df


# TODO: integrate this function with bea_pce_parse above
def bea_pce_ceda_parse(*, year: int, **_: Any) -> pd.DataFrame:
"""
Latest BEA Personal Consumption Expenditure by Major Type of Product from
https://apps.bea.gov/iTable/?reqid=19&step=2&isuri=1&categories=survey&_gl=1*1mu0824*_ga*MTkyNDEyMDE5LjE3MTA0NjE1MjE.*_ga_J4698JNNFT*MTcxMDQ2MTUyMC4xLjEuMTcxMDQ2MjIyNS4xNC4wLjA.#eyJhcHBpZCI6MTksInN0ZXBzIjpbMSwyLDMsM10sImRhdGEiOltbImNhdGVnb3JpZXMiLCJTdXJ2ZXkiXSxbIk5JUEFfVGFibGVfTGlzdCIsIjY1Il0sWyJGaXJzdF9ZZWFyIiwiMjAxMiJdLFsiTGFzdF9ZZWFyIiwiMjAyMyJdLFsiU2NhbGUiLCItNiJdLFsiU2VyaWVzIiwiQSJdXX0=

modified version of load_bea_personal_consumption_expenditure()
"""
tbl = load_from_gcs(
name="BEA Personal Consumption Expenditures by Major Type of Product_June27_2024.csv",
sub_bucket=gcs_extract_input_path("BEA_PCE"),
local_dir=local_extract_input_dir("BEA_PCE"),
loader=lambda pth: pd.read_csv(
pth,
skiprows=3,
index_col=1,
)
.dropna()
.drop(columns=["Line"]),
)
tbl.index = tbl.index.str.strip()

df = tbl[[year]]
df = df.rename(columns={'2023': 'Year'})
df = df.reset_index().rename(columns={'index': 'ActivityProducedBy'})
df = (
df.assign(Location='00000')
.assign(FlowName='Personal consumption expenditures')
.assign(Unit='Dollars / p')
)

# add location system based on year of data
df = assign_fips_location_system(df, year)
# add hard code data
df['SourceName'] = 'BEA_PCE_CEDA'
df['Class'] = 'Money'
df['Compartment'] = None
df['FlowType'] = "ELEMENTARY_FLOW"

return tbl


if __name__ == "__main__":
from bedrock.extract.flowbyactivity import getFlowByActivity
from bedrock.extract.generateflowbyactivity import generateFlowByActivity
Expand Down
10 changes: 5 additions & 5 deletions bedrock/extract/iot/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@
"Mechanical power transmission equipment manufacturing": ["333613"],
"Other engine equipment manufacturing": ["333618"],
"Air and gas compressor manufacturing": ["333912"],
"Pump and pumping equipment manufacturing": ["33391A"],
"Pump and pumping equipment manufacturing": ["333914"],
"Material handling equipment manufacturing": ["333920"],
"Power-driven handtool manufacturing": ["333991"],
"Packaging machinery manufacturing": ["333993"],
Expand Down Expand Up @@ -251,10 +251,10 @@
"Electric lamp bulb and part manufacturing": ["335110"],
"Lighting fixture manufacturing": ["335120"],
"Small electrical appliance manufacturing": ["335210"],
"Household cooking appliance manufacturing": ["335221"],
"Household refrigerator and home freezer manufacturing": ["335222"],
"Household laundry equipment manufacturing": ["335224"],
"Other major household appliance manufacturing": ["335228"],
"Household cooking appliance manufacturing": ["335220"],
"Household refrigerator and home freezer manufacturing": ["335220"],
"Household laundry equipment manufacturing": ["335220"],
"Other major household appliance manufacturing": ["335220"],
"Power, distribution, and specialty transformer manufacturing": ["335311"],
"Motor and generator manufacturing": ["335312"],
"Switchgear and switchboard apparatus manufacturing": ["335313"],
Expand Down
Loading
Loading