Skip to content

Lingaro/coding-standards-training

Repository files navigation

Data Scientists Coding Standards Training

Welcome to the Coding Standards Training Repository for Data Scientists! This repository contains demos, tasks, and reference materials to help you write cleaner, more maintainable Python code.

Prerequisites

Before starting, please complete the setup instructions in SETUP.md.

Repository Structure

coding-standards-training/
├── demos/                    # Demonstration materials (follow along)
│   ├── 01-code-style/        # Code formatting, linting, type checking
│   ├── 02-testing/           # Unit testing with pytest
│   ├── 03-collaboration/     # Pre-commit hooks, CI/CD, static analysis
│   ├── 04-documentation/     # Docstrings and Sphinx documentation
│   ├── 05-tools-config/      # VSCode setup and Databricks integration
│   └── 06-project-setup/     # Project templates and DevContainers
├── tasks/                    # Hands-on exercises
│   ├── 01-code-style/        # Refactor poorly formatted code
│   ├── 02-testing/           # Write unit tests for a function
│   ├── 05-tools-config/      # Set up Databricks connection
│   └── 06-project-setup/     # Use Cookiecutter and DevContainers
├── .vscode/                  # VSCode workspace settings
├── pyproject.toml            # Python project configuration
├── requirements.txt          # Python dependencies
├── .pre-commit-config.yaml   # Pre-commit hooks configuration
└── SETUP.md                  # Setup instructions

Topics Covered

1. Code Style & Guidelines

Learn how to format Python code according to PEP8 using Ruff, and how to use type hints with mypy.

2. Testing

Learn how to write and execute unit tests using pytest, and how to measure code coverage.

3. Collaboration

Learn how to set up pre-commit hooks for consistency checks, CI pipelines, and static code analysis.

4. Documentation

Learn how to write clear docstrings and generate documentation using Sphinx.

5. Tools & Configuration

Learn how to configure VSCode for Python development and connect to Databricks.

6. Project Starting Point

Learn about project structure, Cookiecutter templates, and DevContainers.

Getting Started

  1. Complete the SETUP.md instructions
  2. Install the recommended VSCode extensions (you'll be prompted when opening the repo)
  3. Create a virtual environment and install dependencies:
    python -m venv .venv
    source .venv/bin/activate  # On Windows: .venv\Scripts\activate
    pip install -r requirements.txt
  4. Follow along with the demos in order, then complete the corresponding tasks

Tools Used

Tool Purpose
Ruff Linting and formatting (replaces flake8, black, isort)
mypy Static type checking
pytest Testing framework
pytest-cov Code coverage
pre-commit Git hooks for code quality
Sphinx Documentation generator
Cookiecutter Project templates

Need Help?

If you encounter any issues during the training, please ask your instructor for assistance.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages