-
Notifications
You must be signed in to change notification settings - Fork 21
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
Policy2code widget #1782
base: master
Are you sure you want to change the base?
Policy2code widget #1782
Conversation
… into policy2code_widget
Modifying 'calculate' function to save tracer log
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.
@leehengpan Thanks for this. Everything looks good so far, all that remains is actually writing to the local database so that we're able to pull the output on the front end.
…-api into policy2code_widget
I took a stab at this for time purposes - not sure if the test etc. is implemented correctly - lmk what you think |
1225c59
to
b337065
Compare
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.
Thanks for this @leehengpan. I've noted some places where I think edits would be necessary.
Also, I want to note that we'll have to do two things at the end:
- Update the added test
- Delete
tracer_output_outer_function.json
, though it may be helpful as we create the parsing function
policyengine_api/api.py
Outdated
@@ -117,6 +118,10 @@ | |||
|
|||
app.route("/<country_id>/user_profile", methods=["PUT"])(update_user_profile) | |||
|
|||
app.route("/<country_id>/tracer_analysis", methods=["GET"])( | |||
trigger_tracer_analysis |
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.
While this is a valid name, it doesn't follow standard naming conventions. Could you instead call this get_tracer_analysis
?
policyengine_api/country.py
Outdated
# write a recursive function here that, when there is an adds and/or a subtracts, calls get_all_variables on that next tier downward, until eventually you hit some marker of there being no more levels. | ||
|
||
|
||
def get_all_variables( |
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.
All of the below function (and its comments) should be deleted
policyengine_api/data/initialise.sql
Outdated
country_id VARCHAR(3) NOT NULL, | ||
api_version VARCHAR(10) NOT NULL, | ||
tracer_output JSON NOT NULL, | ||
-- variable_name VARCHAR(255) NOT NULL |
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.
We can fully delete this line
country_id VARCHAR(3) NOT NULL, | ||
api_version VARCHAR(10) NOT NULL, | ||
tracer_output JSON NOT NULL, | ||
-- variable_name VARCHAR(255) NOT NULL |
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.
We can delete here, as well
|
||
household_id = request.args.get("household_id") | ||
policy_id = request.args.get("policy_id") | ||
|
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.
variable = request.args.get("variable") |
We will actually still need to which variable we're analyzing later in this function. It'd be good to add this back.
Fix from Pull Request #1781