Closed hdoupe closed 6 years ago
There are no changes in the data submission logic in pr #923. The only substantive change is making dropq_compute
an argument in submission functions process_reform
and submit_reform
. This is essential so that the test suite can check that the correct data is submitted to the backend.
The most recent commit does not change the test logic but does remove a hack that allowed PolicyBrain to use unit tests and pytest at the same time. My "hack" was broken in pytest release 3.7.1 (most likely by the patch for issue pytest-dev/pytest#3747).
@hdoupe said:
There are no changes in the data submission logic in pr #923. The only substantive change is making
dropq_compute
an argument in submission functionsprocess_reform
andsubmit_reform
.
Why is there any mention of dropq
in PolicyBrain? It was only relevant to TaxBrain (not any other model), but that terminology is long obsolete even for TaxBrain/Tax-Calculator.
@martinholmer Good question. @lucassz was also curious about this when he first started. We are phasing out the use of "dropq" throughout PolicyBrain. In PR #922, "dropq" was removed from many of the Compute
methods. We plan to make further changes in #921 to remove "dropq" from variable names and URL extensions.
@lucassz can you review?
@hdoupe said:
@martinholmer Good question. @lucassz was also curious about this when he first started. We are phasing out the use of "dropq" throughout PolicyBrain. In PR #922, "dropq" was removed from many of the Compute methods. We plan to make further changes in #921 to remove "dropq" from variable names and URL extensions.
Sounds like a sensible plan. I know from experience that reworking code this large and complex is a difficult and time-consuming task.
Looks good to me, this is a very good start. I'll think of whether there's any other ways we can further improve the structure of this.
Thanks for taking a look @lucassz. One way to break submit_reform
down is:
in what context is it called?
is the input OK?
quick calc or full calc?
There's a lot of shared code and data between all of the paths through that I outline above. This leads me to think that this should be some type of class.
I'm inclined to merge this as is to make the work in #921 smoother by reducing clutter in the TaxBrain views module. We can then begin tinkering with different ways to approach this problem while we are wrapping up #921.
Does this seem sensible?
Yes, I agree that it will be easier to do more in-depth refactoring (such as packaging it into a class) once this is merged into master and constitutes the base to start from.
See #894:
I am starting #894 with a clean slate given the extensive changes to code style and the
compute.py
architecture.