fitnr / addfips

Add state and county fips codes to data
GNU General Public License v3.0
41 stars 12 forks source link

county FIPS files contain out of date counties #8

Closed TrentonBush closed 4 months ago

TrentonBush commented 1 year ago

Bedford City, VA (formerly FIPS 51515) was absorbed into Bedford [county], VA (FIPS 51019) in 2013. The Census states:

Its former FIPS State and FIPS County codes 51-515 have ceased to exist

But it still appears in addfips county FIPS files for both 2015 and 2020. Census data of those vintages do not have FIPS 51515. Furthermore, despite the official name of the county being "Bedford", the literal string "Bedford" maps to Bedford City, so most data is assigned the wrong FIPS code. There may be other out of date entries, but I have not checked for them. Is there a reason to include FIPS codes that do not exist in Census data of the same vintage?

>>> import addfips
>>> fip = addfips.AddFIPS(vintage=2020)
>>> fip.get_county_fips('bedford', 'va')
'51515'
>>> fip.get_county_fips('bedford county', 'va')
'51019'
>>> fip.get_county_fips('bedford city', 'va')
'51515'
fitnr commented 1 year ago

The older counties are kept merely for backwards compatibility. This is appropriate for a renaming, but not in this case. A fix is forthcoming.

e-belfer commented 4 months ago

@fitnr Thank you for fixing this issue! Would you able to release a new version of the package that incorporates this commit? We haven't yet been able to take advantage of the fix you made as we're still using the last release.

fitnr commented 4 months ago

Update has been pushed

e-belfer commented 4 months ago

Thanks a lot, greatly appreciated!

e-belfer commented 4 months ago

@fitnr Looks like the commit in question is still in the fix8 branch and hasn't been merged into main, and thus wasn't included in the last release unfortunately! https://github.com/fitnr/addfips/tree/fix/8