arXiv / arxiv-classifier

Facebook contributed classifier for abstracts
14 stars 2 forks source link

task/ARXIVNG-2659 implement routes with unittests #10

Closed JaimieMurdock closed 5 years ago

JaimieMurdock commented 5 years ago

This PR implements the routes detailed in #2.

It also implements testing for these routes and fleshes out the classifier controller with a classify_stream function. The next ticket (#3) will determine the domain for this function, but a loose approximation is given now with a {classification: probability} (e.g., {"cs.DL": 0.375}) representation from the controller.

One thing to note is that for the classify_stream implementation, I separated out concerns, returning only the data, rather than the headers and status code as well. Those will eventually be handled by the routes as well.

Some additional module configuration was also included, such as pydocstyle and pylint config to match other projects.

JaimieMurdock commented 5 years ago

All scenarios should now be tested. Added a JSON error handler to the blueprint.