Skip to content

Refactor weekday calc into utils #1282

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 10 commits into from
Oct 26, 2021
Merged

Refactor weekday calc into utils #1282

merged 10 commits into from
Oct 26, 2021

Conversation

chinandrew
Copy link
Contributor

@chinandrew chinandrew commented Oct 1, 2021

Description

Refactor DV, CHNG, and Claims_hosp to use the same calc_adjustment (fc5c8dd)and weekday function (1175e5d and later) and move into delphi utils . CHNG and claims_hosp were previously using the same one while DV had a multi-column version.

Changelog

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

  • Add column argument to calc_adjustment and have it loop through each one.
  • Update index management outside function
  • Reshape returns weekday params to be 2D arrays universally
  • Update utils linter config to accept single variable uppercase names (e.g. X)
  • Have weekday take in column and scale arguments.

Fixes

@chinandrew chinandrew marked this pull request as draft October 1, 2021 02:31
@chinandrew chinandrew marked this pull request as ready for review October 1, 2021 02:34
@chinandrew
Copy link
Contributor Author

@mariajahja @rumackaaron For 👀 on this draft.

@chinandrew chinandrew marked this pull request as draft October 1, 2021 14:16
@chinandrew chinandrew marked this pull request as ready for review October 15, 2021 02:42
@chinandrew chinandrew changed the title [DRAFT] Standardize weekday calc_adjustment() function [] Standardize weekday calc_adjustment() function Oct 15, 2021
@alexcoda alexcoda changed the title [] Standardize weekday calc_adjustment() function Standardize weekday calc_adjustment() function Oct 15, 2021
@chinandrew chinandrew changed the title Standardize weekday calc_adjustment() function Refactor weekday calc into utils Oct 15, 2021
@rumackaaron
Copy link
Contributor

Just noticed that we have no weekday tests. Would it be possible to confirm that the output of the indicators is unchanged by the refactor?

@chinandrew
Copy link
Contributor Author

Just noticed that we have no weekday tests. Would it be possible to confirm that the output of the indicators is unchanged by the refactor?

Yea definitely would be a good idea. Are there any trivial input/outputs we could use to verify the minimization is working? Or at worst we can just rerun the old implementation on some test data (on the assumption it's working) and make sure the new one outputs the same values.

@rumackaaron
Copy link
Contributor

Unfortunately, with the L1 smoothing I don't think there are trivial outputs that will work. I think the second suggestion makes sense.

The expected values in these tests were generated by running the version of these methods on master
@alexcoda
Copy link
Contributor

@rumackaaron Added some tests for the weekday.py methods. The expected values in the tests were generated by running the test values through the methods on main.

@krivard krivard merged commit 0e20612 into main Oct 26, 2021
@krivard krivard deleted the weekday-calc-refactor branch October 26, 2021 18:56
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.

Move weekday.py into shared utils
4 participants