Macintoshxz / schroders

Coding test submission for Schroders

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Schroders Coding Test

Python >= 3.10.2 Testing Coverage 82%

General Comments

  • I have worked on this little project in my free time, around quite a busy work schedule.

  • I have deliberately tried to focus on code readability, as opposed to optimisation ("premature optimisation is the root of all evil").

  • My git commits are too large and infrequent, and my docstrings don't have much thought put into them. This is mainly to speed up development, in the knowledge that this is a toy app.

Installation

I have chosen to use poetry and pyenv. To setup and use the environment:

poetry install
poetry shell

This will automatically create a virtual environment and install the required dependencies.

Usage

Supply a CSV layout of the keypad and a sequence length:

python num_seqs.py --layout=layout.csv --length=10 --max_vowels=2

The output will be as per problem.pdf.

Layout CSV

Each square on the keypad is represented by three values:

X position, Y position, Value

Development

Pre-commit Checks

To run them manually:

pre-commit run --all-files

This will run a series of linting and type-checking (flake8, black, mypy) and tell you what needs to be fixed. You may need to run it more than once. It will be automatically run when attempting to commit a change.

Testing

To run tests:

pytest

For test coverage:

pytest --cov=keypad tests/

About

Coding test submission for Schroders


Languages

Language:Python 100.0%