addfips icon indicating copy to clipboard operation
addfips copied to clipboard

county FIPS files contain out of date counties

Open TrentonBush opened this issue 1 year ago • 1 comments

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'

TrentonBush avatar Mar 23 '23 22:03 TrentonBush

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

fitnr avatar Mar 28 '23 13:03 fitnr

@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.

e-belfer avatar Jun 17 '24 13:06 e-belfer

Update has been pushed

fitnr avatar Jun 19 '24 18:06 fitnr

Thanks a lot, greatly appreciated!

e-belfer avatar Jun 19 '24 18:06 e-belfer

@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

e-belfer avatar Jun 20 '24 19:06 e-belfer