Add pandas + matplotlib data-visualization example#33
Draft
TomNaessens wants to merge 6 commits into
Draft
Conversation
Demonstrates a TESTed Python exercise that combines CSV reading with pandas, data aggregation, and chart generation with matplotlib. The suite has 5 tabs (29 tests): 16 standard-DSL tests for the analytic functions and 13 Python-specific expressions inspecting properties of the returned matplotlib Figure (title, axis labels, bar count, bar heights, tick labels). Four Pokémon CSV files of varying size live in workdir/ so the judge auto-mounts them at test time. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- New description/boilerplate/boilerplate file pre-fills the editor with function stubs and an __main__ block that calls every function on pokemon.csv and renders the bar chart. Students replace the NotImplementedError stubs and immediately see results when they press Run in the sandbox. - solution/solution.py gains the same __main__ block so the teacher preview matches the student-facing scaffold. - description/media/ now ships the four CSVs and both description files link to them so users can grab the data into the sandbox. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Following the tested/files convention: runtime data files live in workdir/, not in description/media/. Removed the four CSV copies and dropped the now-broken `[file](media/foo.csv)` links from both descriptions, with a short note that the files are already pre-loaded in the sandbox. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Reverts the previous cleanup: data files for TESTed exercises need to live in BOTH workdir/ (so the judge can mount them at test time) and description/media/ (so the description's [name](media/foo.csv) links render and let users open the file). The two copies stay in sync. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Papyros imports student code under module name "sandbox"; TESTed imports it as "submission"; "__main__" never matches in either context, so the previous `if __name__ == "__main__":` block was dead code on Dodona. Using `if __name__ == "sandbox":` makes the demo fire only when the student presses Run in the sandbox, while remaining invisible to the judge (still 29/29 with reference). Both descriptions updated to mention the construct explicitly. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Contributor
Author
Tabs are shown to the student in Dodona's feedback panel; English
reaches a wider audience than Dutch even though the exercise itself is
bilingual. "Aantal Pokémon" -> "Number of Pokémon", "Sterkste" ->
"Strongest", "Sterkste per type" -> "Strongest per type", "Grafiek"
-> "Chart". ("Types" was already language-neutral.)
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
auto-merge was automatically disabled
May 29, 2026 07:41
Pull request was converted to draft
Contributor
Author
|
Drafted until we have a working judge side of matplotlib running & evaluation |
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.


Summary
Adds a new example exercise under
tested/data-visualization/that demonstrates a TESTed Python exercise combining CSV reading with pandas, data aggregation, and chart generation with matplotlib. The Pokémon-themed data set is meant to be relatable for students.The exercise asks students to implement six functions across four small CSV files (
pokemon.csv,starters.csv,eeveelutions.csv,legendary.csv):load_pokemon,number_of_pokemon,all_types,strongest_pokemon,strongest_per_type, andplot_top_pokemon. The suite has 5 tabs with 29 test cases — 16 standard-DSL tests for the analytic functions and 13 Python-specificexpressionblocks that inspect properties of the returnedmatplotlib.figure.Figure(title, axis labels, bar count, bar heights, x-tick labels) via a context-sharedfigvariable.The four CSV files live in
workdir/so the judge auto-mounts them at test time — nofiles:directive needed in the suite.Dependency note
The exercise needs
matplotlib(andpandas) inside thedodona-testedDocker image.pandasis already in the upstream Dockerfile;matplotlibis not yet there. A separate change tododona-edu/docker-imagesis needed before this exercise can run on the live platform. Verification for this PR was done locally against adodona-testedimage withpandasandmatplotliblayered on top.PRs are open in dodona-edu/docker-images#404 to support that soon, but we won't do those now sinze we have to increase the disk size first.
Test plan
python3 -m tested.dsl -i evaluation/suite.yaml)# wrong) is rejected on all 61 generated testsmatplotlibis added to thedodona-testedimage before the exercise is exposed to students🤖 Generated with Claude Code