Closed ZachGlassman closed 6 years ago
Ok, so my understanding here is that the html filename would have to be changed from "index.html" to "predict.html" for this change to actually be effective. (My understanding of Flask is growing rather slowly.)
Or is it that the function name for the route needs to be changed? So
@app.route('/predict') def predict(): ...
The template rendered is controlled by the render_template
function, the route itself does not necessarily need to be related
Sorry, maybe I edited my comment after you saw it... (Bad practice...)
Does the name of the function that defines the route need to match the route?
@app.route('/predict') def predict(): ...
Nope! @app.route('/whatever')
simply says that the URL/endpoint will be [domain]/whatever (e.g. www.example.com/whatever). The function name and the template name used in render_template()
are free be whatever you like, though it is conventional that these three things match.
Ok, then I guess I don't understand what is causing the tests to fail in this case. Any hint?
The hint is that my commit on this branch caused the tests to fail. The tests check that there is something at /
.
Ok, well given that, I'd tend to reject this change since the tests are failing. (I thought that the idea of accepting a change is that the result will be "deployable" after the change is accepted.)
Valid point in general, however I would like you to write code to make the tests pass. Sort of like test driven development.
Ok, let's approve this and I'll work on issue #6 to create an index page.
please do so on this branch and when tests pass we will review.
this looks good, tests are failing because they are testing the /
route for predictions but its no longer the predict route, so you will need to change them to hit the /predict route.
Ok, I am pretty certain that I'm not understanding everything that's going on here with the tests. ;)
The tests are mostly passing, you will need to fix a few things for pylint and then this is good!
forecaster/forecaster.py:15:0: E0011: Unrecognized file option 'diasable' (unrecognized-inline-option) forecaster/forecaster.py:15:4: W0612: Unused variable 'landing' (unused-variable)
so I think the first one is just a typo (diasable != disable) and the second one might also disappear if that first one is fixed.
Checks have passed now. The merge conflict needs to be resolved. But I think this resolves this issue, as well as Issue 6.
I'll let @ZachGlassman voice his own opinion here, but usually the way I address conflicts is to locally rebase the branch on master (resolving the conflicts locally during the rebase), close the current PR and delete the remote branch, and then push the local branch to the remote and open a new PR.
Please do as Dylan suggested and assign me to merge.
Addresses https://github.com/thedataincubator/forecaster/issues/6