This repository follows a professional, chapter-based workflow inspired by the data-algorithms-with-pyspark repository pattern.
Create a feature branch for each chapter:
git checkout -b feature/chapter-01
git checkout -b feature/chapter-02Each chapter directory should contain:
src/chapter_XX/
├── __init__.py # Module docstring describing the chapter
├── README.md # Chapter overview, notebook table, key concepts
├── 01_topic_name.ipynb # Jupyter notebooks (primary content)
├── 02_another_topic.ipynb
└── data/ # Sample data files if neededNotebooks are the primary learning material. When creating them:
- Keep each notebook focused on one topic
- Interleave markdown explanations with executable code cells
- Number notebooks sequentially:
01_topic_name.ipynb,02_another_topic.ipynb - Include output for key demonstrations
- Reference the book chapter and section numbers
- Use type hints in code cells
# Open notebooks for editing
make jupyter CHAPTER=chapter_XXEach chapter README should include:
- Overview: Brief chapter summary
- Notebooks table: All notebooks with topics covered
- Key Concepts: Code examples showing main ideas
- Testing: How to run chapter tests
- References: Links to book sections and external resources
Add tests for each chapter in tests/test_chapter_XX.py:
"""Tests for Chapter XX: Topic Name."""
import pytest
class TestConceptName:
"""Test concept from Chapter XX."""
def test_specific_behavior(self) -> None:
"""Description of what's being tested."""
result = some_operation()
assert result == expected_valueTests should verify the concepts covered in notebooks - they serve as executable documentation.
Before committing, run all checks:
# Single command to check everything
make check
# Or individual checks
make lint # Ruff linter
make format # Code formatting
make type-check # mypy type checking
make test # pytestWrite clear commit messages:
feat(ch01): Add core concepts and control flow notebookstest(ch02): Add type system and scoping testsdocs(ch03): Update OOP chapter READMEfix(ch04): Fix metaclass example in notebookrefactor(ch05): Reorganize decorator examples
When ready, open a PR with:
- Clear title:
Add Chapter 3 - OOP Fundamentals - Description of notebooks included and concepts covered
Enforced by make format (ruff):
- Line length: 100 characters
- 4 spaces for indentation
- f-strings for formatting
- snake_case for functions/variables
- PascalCase for classes
- UPPER_CASE for constants
- All chapters should have corresponding test files
- Tests verify the concepts, not just run without error
- Use pytest fixtures for common setup (see
conftest.py) - Class-based test organization matching chapter topics