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

Add new sectors to NAICS crosswalks upon crosswalk load #258

Open
bl-young opened this issue Jul 27, 2022 · 1 comment
Open

Add new sectors to NAICS crosswalks upon crosswalk load #258

bl-young opened this issue Jul 27, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@bl-young
Copy link
Collaborator

Needed for external activitytosectormapping files that may include new NAICS (e.g. 7 or 8 digit NAICS) not currently in the crosswalk.

Crosswalk could be appended locally after loading, perhaps in load_crosswalk()

flowsa/flowsa/common.py

Lines 59 to 76 in aaf5403

def load_crosswalk(crosswalk_name):
"""
Load NAICS crosswalk between the years 2007, 2012, 2017
:return: df, NAICS crosswalk over the years
"""
cw_dict = {'sector_timeseries': 'NAICS_Crosswalk_TimeSeries',
'sector_length': 'NAICS_2012_Crosswalk',
'sector_name': 'NAICS_2012_Names',
'household': 'Household_SectorCodes',
'government': 'Government_SectorCodes',
'BEA': 'NAICS_to_BEA_Crosswalk'
}
fn = cw_dict.get(crosswalk_name)
cw = pd.read_csv(f'{datapath}{fn}.csv', dtype="str")
return cw

Currently that crosswalk will only include activitytosectormapping files and NAICS within the flowsa repo

@bl-young bl-young added the enhancement New feature or request label Jul 27, 2022
@matthewlchambers
Copy link
Collaborator

Functionality to add such new "NAICS" codes (or any other industry codes that aren't actual NAICS codes) is in the seea-recursive branch. I needed it to account for emissions from waste decomposition in accordance with SEEA, which says these emissions should be attributed to "accumulations," not to the (current activities of) the waste management industry.

flowsa/flowsa/naics.py

Lines 33 to 37 in fc14218

The top industry_spec dictionary may also include a key 'non_naics', where
the associated value is a non-NAICS "industry" or list of such "industries"
that should be included in the set of industries that can be mapped to.
In this case, the user will need to supply their own crosswalk which maps
activities to that industry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants