Skip to content
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

CHC Signal #320

Merged
merged 7 commits into from
Oct 21, 2020
Merged

CHC Signal #320

merged 7 commits into from
Oct 21, 2020

Conversation

rumackaaron
Copy link
Contributor

This creates a signal from the CHC outpatient data, using the same calculations as the EMR signal. The code currently works for CHC data, but I haven't written code that automates data collection from the ftp server.

@rumackaaron rumackaaron added the API addition New signals label Oct 15, 2020
@rumackaaron rumackaaron marked this pull request as draft October 15, 2020 22:03
@krivard
Copy link
Contributor

krivard commented Oct 16, 2020

Prefer using delphi_utils.geo.GeoMapper to custom geo aggregation routines -- I know you were working off of doctor-visits for this, but that one's on the refactor list as well.

@rumackaaron
Copy link
Contributor Author

Prefer using delphi_utils.geo.GeoMapper to custom geo aggregation routines -- I know you were working off of doctor-visits for this, but that one's on the refactor list as well.

The code actually does use delphi_utils.geo.GeoMapper. The custom geo_maps file is only there from copying and pasting, I can get rid of it.

@krivard krivard requested a review from chinandrew October 16, 2020 17:19


class Constants:
# number of counties in usa, including megacounties
Copy link
Contributor

Choose a reason for hiding this comment

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

can we add a docstring here on what these constants are for, especially since there's also a constants.py file?

Copy link
Contributor

@chinandrew chinandrew Oct 20, 2020

Choose a reason for hiding this comment

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

this + linter and should be good to go. EDIT: there's also a few more instances of single vs double quoting, should be a relatively quick search and replace

@rumackaaron rumackaaron marked this pull request as ready for review October 19, 2020 16:48
@chinandrew
Copy link
Contributor

I'm getting some keyerrors when running tests

COVID_FILEPATH = PARAMS["input_covid_file"]
KeyError: 'input_covid_file'

and

DENOM_FILEPATH = PARAMS["input_denom_file"]
 KeyError: 'input_denom_file'

If I update the params json to point to the two files in test_data/ then tests pass.

Getting a number of linting errors, mostly minor.

@krivard
Copy link
Contributor

krivard commented Oct 20, 2020

Please drop the following files:

  • static/02_20_uszips.csv
  • tests/static/02_20_uszips.csv
  • params.json (sorry about that; i completely spaced that both the code reviewer and the code writer were working in a relatively unfamiliar codebase)

Comment on lines 33 to 34
denom_suffix = params["input_denom_file"].split("/")[-1].split(".")[0][9:]
assert denom_suffix == "All_Outpatients_By_County"
Copy link
Contributor

Choose a reason for hiding this comment

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

might be simpler to regex here but this works. can we add tests for this file?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Tests added

Copy link
Contributor

Choose a reason for hiding this comment

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

Please drop the following files:

  • static/02_20_uszips.csv
  • tests/static/02_20_uszips.csv
  • params.json (sorry about that; i completely spaced that both the code reviewer and the code writer were working in a relatively unfamiliar codebase)

Thanks Katie. There's a tests/params.json I think is ok to be commited (and needs to be set specifically for tests to pass)

Copy link
Contributor

Choose a reason for hiding this comment

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

Realized i quoted the wrong comment here

# Denominator: "YYYYMMDD_All_Outpatients_By_County.dat.gz"
# Numerator: "YYYYMMDD_Covid_Outpatients_By_County.dat.gz"

if params["drop_date"] is None:
Copy link
Contributor

Choose a reason for hiding this comment

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

is it worth testing some of this functionality? just to make sure that all the right files/dates get generated

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The params are loaded straight from params.json so I don't think this can be tested very easily. There is similar code for the hosp signal and this functionality wasn't tested.

@chinandrew
Copy link
Contributor

Aside from open comments, looks good and tests are passing

@krivard krivard merged commit 6008371 into main Oct 21, 2020
@rumackaaron rumackaaron deleted the changehc branch October 21, 2020 20:19
@krivard krivard mentioned this pull request Nov 10, 2020
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API addition New signals
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants