-
Notifications
You must be signed in to change notification settings - Fork 17
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
Refactor usafacts to use geo utils #316
Conversation
…ance with additional comments
usafacts/tests/conftest.py
Outdated
for fname in listdir("../receiving"): | ||
if fname[0] == ".": | ||
continue | ||
remove(join("../receiving", fname)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this can be made into a one liner with
[remove(fname) for fname in glob.glob('receiving/*')]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oops realized this is part of #314
safegraph/tests/test_process.py
Outdated
print(expected) | ||
print(actual) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are these debug statements?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, removed sorry for having the multi sync workspace here.
usafacts/delphi_usafacts/geo.py
Outdated
df = df.copy().sort_values(["fips", "timestamp"]) | ||
for col in COLS: | ||
for col in cols: | ||
# Get values from the aggregated county: | ||
vals = df.loc[df["fips"] == pooled_fips, col].values / len(fips_list) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
small nitpick, but would be good to standardize single vs double quotes within the file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Replace modular arithmetic with string suffix checking. Co-authored-by: chinandrew <chinandrew96@gmail.com>
Blocked on #325. |
Lgtm! |
I just realized there theres still static files that are used in USAFacts, sorry for missing in review. Figure we'll fix it when we add hhs + nation |
The USAFacts indicator no longer uses localized libraries that have been superseded by
delphi_utils.GeoMapper
.Fixes #338, which itself addresses part of #306. Synced to and #309 and #314, so should be submitted after them.