Challenge Overview
Challenge Objectives
-
Port Matlab calculations into Python
-
Python Rest API development using Flask framework
Project Background
-
Our client has developed a specific method of calculating variable filtrate density
-
All the calculations are currently in Matlab - our goal is to port the calculations into Python and expose the calculation endpoint.
-
In this challenge, we’ll implement the calculation endpoint
Technology Stack
-
Python 3
-
Flask
-
Flask-Restplus
Code access
Base code is available in the forums.
Individual requirements
-
Remove all the database related features of the starter pack code
Starter pack code has a couple of database features - saving the calculation data to db, configuration variables for connecting to database and we need to remove those. -
Port the calculations from Matlab to Python
Analyze the provided Matlab code and define the inputs and outputs. A high level code analysis document is provided in the forums. No user input is expected during the calculation - if the user is not satisfied with the results he can call the calculation again. -
Implement the calculation endpoint
Expose the calculations at POST /calculation endpoint (it will accept inputs as json body and return both the inputs and results as json). Calculated values should match those of the Matlab code.
General requirements
-
Unit tests are not required.
-
All endpoints should be annotated with Swagger annotations and swagger UI should be served by the API.
-
All endpoint routes should be prefixed with “API_NAME_”
-
All environment variables have to be prefixed with “API_NAME_”
-
Please make sure your code is well-documented. Use the following style guides Google Python Style Guide, Python Style Guide, and Docstring Conventions. Code linter is required. Please make sure it is well-engineered but not over-engineered (YAGNI and KISS) solution. We're looking for well-structured and tested code. Well-structured code follows good design principles like the SOLID principles and well-tested code has comprehensive unit tests.
-
The code should be implemented using Python3 only.
-
Use matrix operations with numpy/pandas where possible
What To Submit
-
All source code
-
Deployment guide
-
Postman collection containing sample calls for all endpoints (success/failure)
-
Verification guide - how to set up the environment, start the API, and verification screenshots
-
The unit tests coverage report
Scoring Methodology
Contest Specification Requirements(60% weightage)
· Have all major specification requirements been met?
Score: 0-9
Major requirements are:
· all endpoints are implemented correctly and return the correct data and codes, etc,
· all DB models are defined and contain correct attributes and data types
· Unit tests - minimum coverage 80%
Have all major specification requirements been met?
Score: 0-3
Minor requirements are:
· Postman collection
· Swagger annotations
Best Practices & Comments(30% weightage)
· Does the submission follow standard best practices?
Score: 0-3
This section includes the PEP-8 code style, linter, patterns usage, code comments
Please make sure your code is well-documented. Use the following style guides Google Python Style Guide, Python Style Guide, and Docstring Conventions. Code linter is required. Please make sure it is well-engineered but not over-engineered (YAGNI and KISS) solution. We're looking for well-structured and tested code. Well-structured code follows good design principles like the SOLID principles and well-tested code has comprehensive unit tests.
Deployment and verification guide (10% weightage)
· Does the deployment guide contain everything needed to successfully configure and deploy the API?
Score: 0-3