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)
- Download and install python3 from .
- Create a virtual environment.
- Activate virtual environment.
- Install Python dependencies.
python3 -m venv venv
Note: You may need to install python3-venv
in some distros
source venv/bin/activate
pip install -r requirement.txt
Running script
- Ensure that you are in virtualenv.
- Run following command:
python3 generate_plan.py <path_to_json_data>
Running sample data
- Ensure that you are in virtualenv.
- Run following command:
python3 generate_plan.py sample_data/sample1.json
Running tests
- Ensure that you are in virtual environment.
- Run all tests:
- Get coverage report:
pytest
pytest --cov=conference-planner
Using make to quickly run the demo
- Install make.
- Run make command to get sample result.
- Run make test to run tests.
- Run make cov to get coverage report.
sudo apt install make
make
make test
make cov
If test fails then these environment are manually needed to be cleaned up.
Running CI workflows
- Create a pull request
- Github workflow should run CI workflows namely
- Pytest
- Code Analyzer
- Code Scanner