Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Autograde Preprocessor: IgnorePattern #1904

Merged
merged 2 commits into from
Aug 9, 2024

Conversation

AlirezaT99
Copy link
Contributor

Creating a new preprocessor, which is useful for removing specific warning cells that might result in a false-negative autograde result. This is used when the assignment is already out and released, but you notice a problem in a test after the fact. This provides a much easier way of recovering compared to editing the assignment.

We at @AaltoSciComp came across an issue where Torch raised a specific warning on stderr (due to some avx1 incompatibility in the node on which the grading would happen), and the auto-grader would mark the solution as wrong. Since the warning was not a Python Warning object (NNPACK.cpp warning), it cannot be suppressed the usual way. Since this warning can't be easily predicted in advance, the assignment couldn't be made to compensate for it.

We addressed the problem by inserting this preprocessor in the c.Autograde.autograde_preprocessors list immediately after Execute to detect and remove pre-defined warning (stderr) outputs from GradeCells. The module uses a configured regular expression (c.IgnorePattern.pattern) to find and delete the matching outputs before the grading process. The default value is empty, which short-circuits the processing so has no effect (and anyway an empty value would have no effect by default).

It shouldn't be needed often, but when it's needed it will save a lot of time.

It has tests and all. We haven't used it live since we made it too late, but we definitely had a need for it.

Copy link
Contributor

Binder 👈 Launch a Binder on branch AaltoSciComp/nbgrader/ignore-pattern

Copy link
Contributor

@brichet brichet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @AlirezaT99, LGTM

@brichet brichet merged commit ef44180 into jupyter:main Aug 9, 2024
26 checks passed
@brichet
Copy link
Contributor

brichet commented Aug 9, 2024

@meeseeksdev backport to 0.8.x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants