diff --git a/08_text_editors/3_debugger.md b/06_debugger/README.md similarity index 100% rename from 08_text_editors/3_debugger.md rename to 06_debugger/README.md diff --git a/06_testing/README.md b/07_testing/README.md similarity index 100% rename from 06_testing/README.md rename to 07_testing/README.md diff --git a/06_testing/coverage.md b/07_testing/coverage.md similarity index 100% rename from 06_testing/coverage.md rename to 07_testing/coverage.md diff --git a/06_testing/testing_dataframes.md b/07_testing/testing_dataframes.md similarity index 100% rename from 06_testing/testing_dataframes.md rename to 07_testing/testing_dataframes.md diff --git a/07_object_oriented_programming/README.md b/08_object_oriented_programming/README.md similarity index 100% rename from 07_object_oriented_programming/README.md rename to 08_object_oriented_programming/README.md diff --git a/08_text_editors/1_setup.md b/08_text_editors/1_setup.md deleted file mode 100644 index f1c4656..0000000 --- a/08_text_editors/1_setup.md +++ /dev/null @@ -1,97 +0,0 @@ -# Get started with Python in VS Code (0h20) - -The first thing you need after installing VS Code is to install the [Python extension](https://marketplace.visualstudio.com/items?itemName=ms-python.python). This extension is the official Python plugin for VS Code and it provides a lot of useful features. - -The second thing you need to do is to select a Python interpreter. 9 out of 10 times your get a `ModuleNotFound` error is because you are using the wrong interpreter. The Python extension will try to detect the interpreter for you, but you can also select it manually. - -Make sure you read about deal with environments and the Python interpreter in VS Code: [VSCode docs: Environments](https://code.visualstudio.com/docs/python/environments) - -## Setting up VS Code for Python development (0h10) - -### Configuration - -VSCode is highly customizable. This customization lives in the `.vscode/settings.json` file and can be altered either in that file directly or via the user interface. - -> Make sure you have added the `.vscode/` directory to the `.gitignore` file, so your settings don't end up polluting the Git repository by mistake. - -Here are some useful settings: - ---- - -```json -"editor.rulers": [88, 120] -``` - -Render vertical rulers after a certain number of monospace characters. Use multiple values for multiple rulers. Useful in order to ensure no line is too long. - ---- - -```json -"python.testing.pytestEnabled": true OR false, -"python.testing.unittestEnabled": true OR false, -``` - -Helps VSCode identify the Python testing framework being used: pytest vs. unittest. - ---- - -```json -"python.analysis.typeCheckingMode": strict -``` - -Defines the default rule set for type checking. Options are: - -- `off` - no type checking, -- `basic` - More lenient checker. Useful for when working with some external libraries (like Pandas, for instance), -- `strict` - Shows you any error that happens with typing. - ---- - -```json -"editor.formatOnSave": true -``` - -Formats files when they are saved. This allows your code to follow a consistent style automatically. In order to to this, you will need a formatter, like [black](https://github.com/psf/black). There's usually a different formatter for each code style. If you need more information about code styles, it's useful to read a few examples. For example, [Google's Python styleguide](https://google.github.io/styleguide/pyguide.html) is publicly available. The next setting will allow you to choose a formatter. - ---- - -```json -"python.formatting.provided": "black", -``` - -Option to determine how VSCode should format your code. Possible formatters are `Black`, `Autopep8`, and `Yapf`. - ---- - -```json -"editor.formatOnSaveMode": "file" -``` - -This controls how the file will be formatted. Options are: - -- `file` - formats entire file, -- `modifications` - formats only what was modified (requires version control), -- `modificationsIfAvailable` - attempts to format only what was modified, but if version control is not available, formats the entire file. - ---- - -```json -"editor.codeActionsOnSave": ["source.organizeImports"] -``` - -VSCode allows for other actions to be performed when the file is saved. Each action should be added to the list and will be executed in order. The most popular action is `source.organizeImports` which sorts the file imports. - ---- - -```json -"python.linting.pylintEnabled": true, -"python.linting.enabled": true, -``` - -`python.linting` is where the linting options live. The Python extension supports `Pylint`, `bandit`, `pylama`, `Pydocstyle`, `Pycodestyle`, `Prospector`, `Mypy`, and `Flake8`. - -## Recommended plugins, Tasks and the Test Explorer - -[Link to document](https://docs.google.com/document/u/1/d/1xHJ9Kq9OVsWh4OH8DYB_7dsKW2tzCPZ8FOI9VrGU2SU) - -This document helps you setup VS Code's Test Explorer, Tasks. It also provides some plugins recommendations. diff --git a/07_text_editors/1_setup.md b/09_text_editors/1_setup.md similarity index 100% rename from 07_text_editors/1_setup.md rename to 09_text_editors/1_setup.md diff --git a/08_text_editors/2_productivity.md b/09_text_editors/2_productivity.md similarity index 100% rename from 08_text_editors/2_productivity.md rename to 09_text_editors/2_productivity.md diff --git a/08_text_editors/README.md b/09_text_editors/README.md similarity index 100% rename from 08_text_editors/README.md rename to 09_text_editors/README.md diff --git a/09_design_patterns/README.md b/10_design_patterns/README.md similarity index 100% rename from 09_design_patterns/README.md rename to 10_design_patterns/README.md diff --git a/README.md b/README.md index 1fa4b56..523d69b 100644 --- a/README.md +++ b/README.md @@ -92,10 +92,11 @@ Week 04 _(~2.5 hours)_ - Assignment #1 -Week 05 _(~2 hours)_ +Week 05 _(~2.5 hours)_ - Git strategies - Assessing code quality: reviews and structures +- Debugging Week 06 _(~2.5 hours)_ @@ -113,7 +114,7 @@ Week 09 _(~2.5 hours)_ - Object-oriented programming -Week 10 _(~3.5 hours)_ +Week 10 _(~3.0 hours)_ - Text editors - Assignment #4 diff --git a/assignments/assignment_2/README.md b/assignments/assignment_2/README.md index 6bd75f2..71808b4 100644 --- a/assignments/assignment_2/README.md +++ b/assignments/assignment_2/README.md @@ -74,3 +74,9 @@ By understanding we mean a very simple task: prepare a brief general description 1. Can you identify the main folders? Without looking at the code (you can only look inside other folders) what is their purpose? 2. Where is the main script of the package located? + +# Assignment 2: code exploration using a debugger + +The last part of this assignment is easy, but very important. One of the most common scenarios is to stumble upon code you have not written yourself. Especially when facing big projects, this might come across as a daunting task. Fortunately, debuggers come to the rescue! One of the possible use cases for debuggers is understanding a new piece of code, especially for studying its intricacies and connections. By introducing strategic breakpoints, one can understand the intended flow of the project and the different parts it is composed of. + +That situation takes us to our next exercise: in the next module, we will focus on testing. But first, we would like you to use a debugger to try to understand how the current testing code actually works, what is being called, etc. \ No newline at end of file