Skip to content

itsankitkp/assignment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Assignment Project for allocating Conference tracks

This repo contains a python script for solution of problem #3.
The following conditions are followed:

  • The conference has multiple tracks each of which has a morning and afternoon session.
  • Each session contains multiple talks
  • Morning sessions begin at 9am and must finish by 12 noon, for lunch
  • Afternoon sessions begin at 1pm and must finish in time for the networking event.
  • The networking event can start no earlier than 4:00 and no later than 5:00.
  • No talk title has numbers in it.
  • All talk lengths are either in minutes (not hours) or lightning (5 minutes).
  • Presenters will be very punctual; there needs to be no gap between sessions.

Note: Sample out in the given in the pdf didn't align with all given condition, namely networking event were scheduled post closing time (5PM). Such diversion from given condition is not implemented and condition (as mentioned) is strictly followed.

Installing dependencies (Debian/Ubuntu or equivalent)

  1. Download and install python3 from .
  2. Create a virtual environment.
  3. python3 -m venv venv
    

    Note: You may need to install python3-venv in some distros

  4. Activate virtual environment.
  5. source venv/bin/activate
    
  6. Install Python dependencies.
  7. pip install -r requirement.txt
    

Running script

  1. Ensure that you are in virtualenv.
  2. Run following command:
  3. python3 generate_plan.py <path_to_json_data>
    

Running sample data

  1. Ensure that you are in virtualenv.
  2. Run following command:
  3. python3 generate_plan.py sample_data/sample1.json
    
Choose different sample files: sample1.jsom, sample2.json, sample3.json or create your own using these files.

Running tests

  1. Ensure that you are in virtual environment.
  2. Run all tests:
  3. pytest
    
  4. Get coverage report:
  5. pytest --cov=conference-planner
    

Using make to quickly run the demo

  1. Install make.
  2. sudo apt install make
    
  3. Run make command to get sample result.
  4. make
    
  5. Run make test to run tests.
  6. make test
    
  7. Run make cov to get coverage report.
  8. make cov
    
    Note: #3 and #4 create temperatory virtual environment.
    If test fails then these environment are manually needed to be cleaned up.

Running CI workflows

  1. Create a pull request
  2. Github workflow should run CI workflows namely
    • Pytest
    • Code Analyzer
    • Code Scanner