USEPA / flowsa

Library that attributes resource use, waste, emissions, and loss to economic sectors
MIT License
23 stars 19 forks source link

update industry_spec_key() so it is not based on sector string length #342

Closed catherinebirney closed 1 year ago

catherinebirney commented 1 year ago
catherinebirney commented 1 year ago

@matthewlchambers in my update of mapping source_naics to target_naics I did include the option of including non_naics (e.g., "non_naics: ACC") but I didn't quite understand what was happening originally so I'm not sure I included it correctly and I'd appreciate if you would check that the non_naics map correctly

matthewlchambers commented 1 year ago

@matthewlchambers in my update of mapping source_naics to target_naics I did include the option of including non_naics (e.g., "non_naics: ACC") but I didn't quite understand what was happening originally so I'm not sure I included it correctly and I'd appreciate if you would check that the non_naics map correctly

Yep, I'll check that! I like this, it's much smoother than what I had before!

matthewlchambers commented 1 year ago

I really love the new crosswalk, and the use of melt! This is sooo much easier to follow than what I had before, in addition to being more robust.

I just pushed 3 commits to this branch, making the following minor changes:

  1. I changed the code that loops through industry_spec and updates target_naics to make the logic a little simpler.
  2. I updated the code for non_naics to make it clearer than my original version and (incidentally) allow the user to specify a list of non-NAICS codes if needed.
catherinebirney commented 1 year ago

Looks good, thanks @bl-young and @matthewlchambers. I will merge.