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

Modify webapp backend to process all user input as files #619

Closed
talumbau opened this issue Aug 12, 2017 · 5 comments
Closed

Modify webapp backend to process all user input as files #619

talumbau opened this issue Aug 12, 2017 · 5 comments

Comments

@talumbau
Copy link
Member

With the merge of PSLmodels/Tax-Calculator#1505, Tax-Calculator now supports a JSON reform interface that maps very naturally to the TaxBrain GUI interface. Currently, TaxBrain supports two separate but similar workflows: a GUI interface and a file upload interface. For the GUI interface, there is a significant amount of code that processes the user's input to create a job for submission to the worker nodes. There is a separate path of control to take a file-based input and submit that to the worker nodes. A way to reduce complexity of TaxBrain would be to unify these flows. To do this, code would be written to transform a user's input to a JSON reform (represented in memory as a dictionary) in the style of PSLmodels/Tax-Calculator#1505. For example, this user input:

screen shot 2017-08-07 at 9 41 03 pm

Would be something like:

{
 "policy": {
   "_SS_thd50_joint": {"2019": [36000]}
 }
}

Once this works is completed, the workflows would look like this:

File based reform:

  • take file from user POST and store in memory (already working)
  • submit file contents to worker nodes (already working)

GUI-based reform:

  • take params from user POST (already working)
  • create in-memory representation of reform file based on user input (NEW WORK HERE)
  • submit file contents to work nodes (already working)

After the new work is done, a lot of code could be removed from TaxBrain (e.g. the expand_arrays functions, package_up_vars, etc.) and there would only be one flow of control for submitting jobs to the worker nodes.

cc @MattHJensen, @brittainhard, @PeterDSteinberg, @martinholmer

@martinholmer
Copy link
Contributor

Let me add something to the #619 comment by @talumbau.
In addition to the TaxBrain simplifications outlined by @talumbau, the merge of Tax-Calculator pull request 1502 and Tax-Calculator pull request 1503 offers another TaxBrain simplification: there is no longer a need for TaxBrain to do any policy parameter validations.

cc @MattHJensen, @hdoupe, @brittainhard, @PeterDSteinberg

@martinholmer
Copy link
Contributor

Let me add something else to the #619 comment by @talumbau.
While #619 is labeled an enhancement, when implemented the ideas of @talumbau will fix at least one bug (#596) and perhaps other bugs as well.

cc @MattHJensen, @hdoupe, @brittainhard, @PeterDSteinberg

@martinholmer
Copy link
Contributor

@brittainhard and @PeterDSteinberg,
It has been several days since @talumbau suggested the TaxBrain simplification described in #619, but neither of you have commented on the pros and cons of his suggestion. We would like to hear your views on his suggestion. Can you add your comments to #619?

@MattHJensen @GoFroggyRun @hdoupe

@hdoupe
Copy link
Collaborator

hdoupe commented Aug 16, 2017

@martinholmer said

Let me add something else to the #619 comment by @talumbau. While #619 is labeled an enhancement, when implemented the ideas of @talumbau will fix at least one bug (#596) and perhaps other bugs as well.

I agree. I think this would take care of the TaxBrain GUI input bugs (#596, #598, #607, and #609).

@martinholmer
Copy link
Contributor

TaxBrain 1.0.3, which is using Tax-Calculator 0.10.2, uses the new approach to processing the GUI input that @talumbau suggested in #619. @talumbau, thanks for the strategy, and @hdoupe, thanks for the
implementation. Closing #619.

@MattHJensen @GoFroggyRun

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants