From 270d86dc2d6afefe7804ce9be48fae0f948694f0 Mon Sep 17 00:00:00 2001 From: Chris Pyles Date: Wed, 27 Dec 2023 21:19:11 -0800 Subject: [PATCH 1/2] upgrade grading preprocessor to not seed cells using cell magic --- otter/execute/preprocessor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/otter/execute/preprocessor.py b/otter/execute/preprocessor.py index 25edf262..9a482058 100644 --- a/otter/execute/preprocessor.py +++ b/otter/execute/preprocessor.py @@ -122,7 +122,7 @@ def add_seeds(self, nb): cells = nb.cells[1:] if skip_first else nb.cells for cell in cells: - if cell.cell_type == "code": + if cell.cell_type == "code" and not cell.source.startswith("%%"): cell.source = f"{do_seed}\n{cell.source}" def add_checks(self, nb): From ee0508cd7a53a0e57421217da2f698a071bf04c0 Mon Sep 17 00:00:00 2001 From: Chris Pyles Date: Wed, 27 Dec 2023 21:20:17 -0800 Subject: [PATCH 2/2] changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 86aedc4e..1ddc6774 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ **v5.3.0 (unreleased):** * Updated Otter Assign to throw a `ValueError` when invalid Python code is encountered in test cells per [#756](https://github.com/ucbds-infra/otter-grader/issues/756) +* Fixed an error causing intercell seeding code to be added to cells using cell magic commands which caused syntax errors per [#754](https://github.com/ucbds-infra/otter-grader/issues/754) **v5.2.2:**