Skip to content

Refactor cdc_covidnet to use geo utils #311

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

Merged
merged 4 commits into from
Oct 19, 2020

Conversation

chinandrew
Copy link
Contributor

For #306. Depends on #310 (which is currently the base in this PR for easier review).

Summary of changes:

  • Convert cdc_covidnet indicator to use the GeoMapper utility.
  • Remove old cdc_covidnet specific geo_maps file and code

@chinandrew
Copy link
Contributor Author

chinandrew commented Oct 14, 2020

Unrelated to this refactor but I noticed the static_path argument doesn't appear to be used in update_sensor(), is there any reason it's still included? @eujing

EDIT: I lied, not unrelated

@eujing
Copy link
Contributor

eujing commented Oct 15, 2020

@chinandrew static_path was only used with the original implementation for GeoMaps(static_path), but since that has been refactored I dont think its needed anywhere else.
I agree I think it should be removed!

@chinandrew
Copy link
Contributor Author

chinandrew commented Oct 15, 2020

@chinandrew static_path was only used with the original implementation for GeoMaps(static_path), but since that has been refactored I dont think its needed anywhere else.
I agree I think it should be removed!

Cool thanks for verifying, will remove.

@krivard krivard requested a review from sgsmob October 16, 2020 14:35
Copy link
Contributor

@sgsmob sgsmob left a comment

Choose a reason for hiding this comment

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

Looks good to me pending an answer on my question above.

from_code="state_name",
new_code="state_id",
dropna=False)
# To preserve column order, reassign original column and drop new one
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a test that fails if this line is omitted?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So if hosp_df[APIConfig.STATE_COL] = hosp_df["state_id"].str.upper() is omitted, tests fail because APIConfig.STATE_COL isn't the two letter abbreviation.

if hosp_df.drop("state_id", axis=1, inplace=True) is omitted, tests fail because dimensions are wrong.

I also actually just realized column order for these fields doesn't matter since there's a hosp_df.set_index(["date", "geo_id"], inplace=True) right after, so this is actually just to avoid name collisions since there isn't currently functionality to replace a column while keeping the name the same. I've updated the comment to reflect that.

@krivard krivard merged commit 0befb53 into geoutil_state_extension Oct 19, 2020
@bweaver-work bweaver-work linked an issue Oct 20, 2020 that may be closed by this pull request
@krivard krivard deleted the geo_refactor_cdccovidnet branch October 29, 2020 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor cdc_covidnet to use geo utils #311
4 participants