Giter Site home page Giter Site logo

windson / parking-lot Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 8.64 MB

A quick and dirty implementation of Parking Lot problem

License: GNU General Public License v3.0

Shell 3.15% Ruby 12.15% Python 84.70%
competetive-programming competetive-programming-resources parking-lot parking-lot-problem-solution python makefile vscode unix shell python3

parking-lot's Introduction

Parking Lot Problem Solution

Author: Navule Pavan Kumar Rao

Upgrade pip

python3 -m pip install --upgrade pip

Create Virtual Env named env

python3 -m venv env

Activate virtual env

source env/bin/activate

Update pip of virtual env

python3 -m pip install --upgrade pip

Install dependencies

pip install -r requirements.txt

Generate executable

pyinstaller parking_lot.py

copy the contents of the generate dist/parking_lot directory to the gojek provided bin directory and read the instructions mentioned in How to run.md

How to Run

Mode: file_input.txt

python parking_lot.py file_inputs.txt

Mode: Interactive

python parking_lot.py

To return out of interactive mode type 'exit'

exit

Command to Run Tests

python3 -m unittest

build library

pyinstaller parking_lot.py

Code Coverage report

Step 1:

Run coverage run parking_lot.py file_inputs.txt

Step 2:

Run coverage run parking_lot.py and play with edge cases

Finally generate report command

coverage report -m

Name                      Stmts   Miss  Cover   Missing
-------------------------------------------------------
input_processor.py           90     19    79%   29-32, 35-43, 53, 62, 92, 98, 123, 127-128
models/__init__.py            0      0   100%
models/car.py                 8      0   100%
models/slot.py               16      0   100%
parking_lot.py               14      2    86%   15-17
service/__init__.py           0      0   100%
service/lot_handler.py       64      4    94%   25, 47-49
service/park_service.py      60     17    72%   16, 23, 26, 51, 59, 66, 71-75, 83, 91, 95, 100-103
util/__init__.py              0      0   100%
util/constants.py            14      0   100%
-------------------------------------------------------
TOTAL                       266     42    84%

Generate HTML Code coverage Report

coverage html -d coverage_html

Html report located in coverage_html\index.html directory

parking-lot's People

Contributors

dependabot[bot] avatar windson avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.