Skip to content

Conversation

@krivard
Copy link
Contributor

@krivard krivard commented Dec 1, 2021

Description

We missed this in #1351, and CI didn't catch it because we install with -e 😢

Update the package_data for delphi-utils to include the 2019 and 2020 directories, not just the root csv files.

Changelog

Itemize code/test/documentation changes and files added/removed.

  • setup.py: package_data

Fixes

Include new subdirectories for different years of census data.
@krivard krivard added the bug Something isn't working label Dec 1, 2021
@dshemetov dshemetov self-requested a review December 1, 2021 22:23
@krivard
Copy link
Contributor Author

krivard commented Dec 1, 2021

To test this:

$ git checkout krivard/fix-package-data
$ cd jhu
$ make clean install
$ env/bin/pip uninstall delphi-epidata
$ env/bin/pip install ../_delphi_utils_python/.
$ make test

Copy link
Contributor

@dshemetov dshemetov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but jw: this means that delphi_utils on PyPI should have an error when instantiating GeoMapper() right? I tried installing it and it seems to be fine, so I'm confused. Tbh, most likely pip must be using the -e flag without me invoking it (grrr).

@krivard
Copy link
Contributor Author

krivard commented Dec 1, 2021

What did you try? I get this:

krivard@rinkitink:~/projects/covid/debug$ mkdir check-utils
krivard@rinkitink:~/projects/covid/debug$ cd check-utils/
krivard@rinkitink:~/projects/covid/debug/check-utils$ python3.8 -m venv env
krivard@rinkitink:~/projects/covid/debug/check-utils$ source env/bin/activate
(env) krivard@rinkitink:~/projects/covid/debug/check-utils$ pip install delphi-utils==0.2.5
[...]
(env) krivard@rinkitink:~/projects/covid/debug/check-utils$ python
Python 3.8.12 (default, Sep 10 2021, 00:16:05) 
[GCC 7.5.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from delphi_utils.geomap import GeoMapper
>>> f=GeoMapper()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/krivard/projects/covid/debug/check-utils/env/lib/python3.8/site-packages/delphi_utils/geomap.py", line 136, in __init__
    self._load_crosswalk_from_file(from_code,
  File "/home/krivard/projects/covid/debug/check-utils/env/lib/python3.8/site-packages/delphi_utils/geomap.py", line 145, in _load_crosswalk_from_file
    stream = pkg_resources.resource_stream(__name__, data_path)
  File "/home/krivard/projects/covid/debug/check-utils/env/lib/python3.8/site-packages/pkg_resources/__init__.py", line 1136, in resource_stream
    return get_provider(package_or_requirement).get_resource_stream(
  File "/home/krivard/projects/covid/debug/check-utils/env/lib/python3.8/site-packages/pkg_resources/__init__.py", line 1608, in get_resource_stream
    return open(self._fn(self.module_path, resource_name), 'rb')
FileNotFoundError: [Errno 2] No such file or directory: '/home/krivard/projects/covid/debug/check-utils/env/lib/python3.8/site-packages/delphi_utils/data/2020/zip_fips_table.csv'

@krivard krivard merged commit c4beeb1 into main Dec 1, 2021
@krivard krivard deleted the krivard/fix-package-data branch December 1, 2021 22:51
@dshemetov
Copy link
Contributor

Ok got that same error! I think I was making some derp error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

delphi-utils dual-year geocoding files are not being exported in the package

3 participants