-
Notifications
You must be signed in to change notification settings - Fork 16
Add params to control solver, default Clarabel, pin cvxpy version #1975
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
Changes from all commits
82c0686
d88b707
7784772
2d3f4fc
99128a3
44345c1
dd2cf36
5e9269d
73b5a3f
0a10a4a
7c6865e
f50026e
fa304f1
6b57157
20e43d8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -13,13 +13,13 @@ | |||||||||||||||||||||||||||||||||||||||||||||||
| # third party | ||||||||||||||||||||||||||||||||||||||||||||||||
| import numpy as np | ||||||||||||||||||||||||||||||||||||||||||||||||
| import pandas as pd | ||||||||||||||||||||||||||||||||||||||||||||||||
| from delphi_utils import GeoMapper | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| # first party | ||||||||||||||||||||||||||||||||||||||||||||||||
| from delphi_utils import Weekday | ||||||||||||||||||||||||||||||||||||||||||||||||
| from delphi_utils import GeoMapper, Weekday | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| from .config import Config, GeoConstants | ||||||||||||||||||||||||||||||||||||||||||||||||
| from .load_data import load_data | ||||||||||||||||||||||||||||||||||||||||||||||||
| from .indicator import ClaimsHospIndicator | ||||||||||||||||||||||||||||||||||||||||||||||||
| from .load_data import load_data | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| class ClaimsHospIndicatorUpdater: | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -152,15 +152,18 @@ def update_indicator(self, input_filepath, outpath, logger): | |||||||||||||||||||||||||||||||||||||||||||||||
| data_frame = self.geo_reindex(data) | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| # handle if we need to adjust by weekday | ||||||||||||||||||||||||||||||||||||||||||||||||
| wd_params = Weekday.get_params( | ||||||||||||||||||||||||||||||||||||||||||||||||
| data_frame, | ||||||||||||||||||||||||||||||||||||||||||||||||
| "den", | ||||||||||||||||||||||||||||||||||||||||||||||||
| ["num"], | ||||||||||||||||||||||||||||||||||||||||||||||||
| Config.DATE_COL, | ||||||||||||||||||||||||||||||||||||||||||||||||
| [1, 1e5], | ||||||||||||||||||||||||||||||||||||||||||||||||
| logger, | ||||||||||||||||||||||||||||||||||||||||||||||||
| ) if self.weekday else None | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| wd_params = ( | ||||||||||||||||||||||||||||||||||||||||||||||||
| Weekday.get_params_legacy( | ||||||||||||||||||||||||||||||||||||||||||||||||
| data_frame, | ||||||||||||||||||||||||||||||||||||||||||||||||
| "den", | ||||||||||||||||||||||||||||||||||||||||||||||||
| ["num"], | ||||||||||||||||||||||||||||||||||||||||||||||||
| Config.DATE_COL, | ||||||||||||||||||||||||||||||||||||||||||||||||
| [1, 1e5], | ||||||||||||||||||||||||||||||||||||||||||||||||
| logger, | ||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||
| if self.weekday | ||||||||||||||||||||||||||||||||||||||||||||||||
| else None | ||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+155
to
+166
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the linter is a cruel mistress! id argue that my suggestion has a better style, even if the previous format passed, but the existing code is a fossilized remnant so do what thou wilt...
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||
| # run fitting code (maybe in parallel) | ||||||||||||||||||||||||||||||||||||||||||||||||
| rates = {} | ||||||||||||||||||||||||||||||||||||||||||||||||
| std_errs = {} | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,6 +13,7 @@ | |
| "pylint==2.8.3", | ||
| "pytest-cov", | ||
| "pytest", | ||
| "cvxpy<1.6", | ||
| ] | ||
|
|
||
| setup( | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,6 +18,7 @@ | |
|
|
||
| # first party | ||
| from delphi_utils import Weekday | ||
|
|
||
| from .config import Config | ||
| from .geo_maps import GeoMaps | ||
| from .sensor import DoctorVisitsSensor | ||
|
|
@@ -125,15 +126,19 @@ def update_sensor( | |
| (burn_in_dates >= startdate) & (burn_in_dates <= enddate))[0][:len(sensor_dates)] | ||
|
|
||
| # handle if we need to adjust by weekday | ||
| params = Weekday.get_params( | ||
| data, | ||
| "Denominator", | ||
| Config.CLI_COLS + Config.FLU1_COL, | ||
| Config.DATE_COL, | ||
| [1, 1e5, 1e10, 1e15], | ||
| logger, | ||
| ) if weekday else None | ||
| if weekday and np.any(np.all(params == 0,axis=1)): | ||
| params = ( | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if you want to get a smaller diff, you can probably revert the changes to this file, which will get it ignored by the linter. |
||
| Weekday.get_params( | ||
| data, | ||
| "Denominator", | ||
| Config.CLI_COLS + Config.FLU1_COL, | ||
| Config.DATE_COL, | ||
| [1, 1e5, 1e10, 1e15], | ||
| logger, | ||
| ) | ||
| if weekday | ||
| else None | ||
| ) | ||
| if weekday and np.any(np.all(params == 0, axis=1)): | ||
| # Weekday correction failed for at least one count type | ||
| return None | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,6 +11,7 @@ | |
| "pytest-cov", | ||
| "pytest", | ||
| "scikit-learn", | ||
| "cvxpy>=1.5", | ||
| ] | ||
|
|
||
| setup( | ||
|
|
||
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.
could you make the format of this match the non-legacy test above so its easier to eyeball the differences in values?