Repository navigation
Tighten exercise contracts after a curriculum review - #19
Merged
Merged
Conversation
- Weasel: breed each generation from the best current offspring (discrete generations). match_history is now each parent's score and can fall, and candidate is the final parent. The README, docstrings, notebook and tests say so, and a new test pins down the behaviour. - Known unknowns: move the coverage-study helpers into simulation.py (with tests) so learners write only the interval methods and the interpretation. Helpers take an explicit rng. - Remove tests and stub requirements that only checked input validation (negative sizes, out-of-range probabilities, empty or malformed inputs), as CONTRIBUTING.md asks, in Known unknowns, Weasel, Wordsmith, Word ladder, Sudoku, Sequence alignment, Fitting a mixture, Try, try again and Titanic. - Titanic notebook: fix the focused test command to exercises/titanic_disaster/. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follows a review of the exercises against the aims in
CONTRIBUTING.md: avoid repetition, mechanical work with no payoff, hidden contracts and ambiguity.Changes
Weasel breeds from the best current offspring
match_historyis each parent's score and can fall;candidateis the final parent. The README, docstring and notebook say so, and the "last stubborn letter" investigation now describes the parent's score.test_each_generation_breeds_from_the_latest_offspring.Known unknowns: less repeated bookkeeping
exercises/known_unknowns/simulation.pyprovidescoverage_studyandplot_coverage, with tests intests/test_known_unknowns_simulation.py. They take an explicitrng.Remove validation-only tests
CONTRIBUTING.mdsays not to test negative sizes, out-of-range probabilities or empty/malformed inputs unless that is the point. I removed those tests, and the matching "Raise ValueError…" lines in the stubs, from Known unknowns, Weasel, Wordsmith, Word ladder, Sudoku, Sequence alignment, Fitting a mixture, Try, try again and Titanic. Where the failure is the lesson (penguin and plate joins,UnknownSoundError, the optimiser failure, unknown classifier arguments) the tests stay.Fix
uv run pytest exercises/data_analysis/titanic/ -q; the path is nowexercises/titanic_disaster/.Checks
uv run ruff check .anduv run ruff format --check .pass.uv run pytest --collect-onlycollects all tests.uv run pytest tests -qpasses (278 passed, 2 skipped).