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

Grader Export Cell Fails #686

Closed
bdsomer opened this issue Aug 1, 2023 · 0 comments
Closed

Grader Export Cell Fails #686

bdsomer opened this issue Aug 1, 2023 · 0 comments
Labels
bug Something isn't working
Milestone

Comments

@bdsomer
Copy link
Contributor

bdsomer commented Aug 1, 2023

Describe the bug
When attempting to run the grader.export cell at the bottom of an Otterized notebook, I get the following error:

Running your submission against local test cases...


0.00s - Debugger warning: It seems that frozen modules are being used, which may
0.00s - make the debugger miss breakpoints. Please pass -Xfrozen_modules=off
0.00s - to python to disable frozen modules.
0.00s - Note: Debugging will proceed. Set PYDEVD_DISABLE_FILE_VALIDATION=1 to disable this validation.
0.00s - Debugger warning: It seems that frozen modules are being used, which may
0.00s - make the debugger miss breakpoints. Please pass -Xfrozen_modules=off
0.00s - to python to disable frozen modules.
0.00s - Note: Debugging will proceed. Set PYDEVD_DISABLE_FILE_VALIDATION=1 to disable this validation.

---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
Cell In[4], line 2
      1 # Save your notebook first, then run this cell to export your submission.
----> 2 grader.export(pdf=False, run_tests=True)

File ~/.conda/envs/jup/lib/python3.11/site-packages/otter/check/utils.py:160, in grading_mode_disabled(wrapped, self, args, kwargs)
    158 if type(self)._grading_mode:
    159     return
--> 160 return wrapped(*args, **kwargs)

File ~/.conda/envs/jup/lib/python3.11/site-packages/otter/check/utils.py:147, in incompatible_with.<locals>.incompatible(wrapped, self, args, kwargs)
    145     else:
    146         return
--> 147 return wrapped(*args, **kwargs)

File ~/.conda/envs/jup/lib/python3.11/site-packages/otter/check/utils.py:197, in logs_event.<locals>.event_logger(wrapped, self, args, kwargs)
    195 except Exception as e:
    196     self._log_event(event_type, success=False, error=e)
--> 197     raise e
    199 else:
    200     self._log_event(event_type, results=results, question=question, shelve_env=shelve_env)

File ~/.conda/envs/jup/lib/python3.11/site-packages/otter/check/utils.py:191, in logs_event.<locals>.event_logger(wrapped, self, args, kwargs)
    188     question, results, shelve_env = wrapped(*args, **kwargs)
    190 else:
--> 191     results = wrapped(*args, **kwargs)
    192     shelve_env = {}
    193     question = None

File ~/.conda/envs/jup/lib/python3.11/site-packages/otter/check/notebook.py:403, in Notebook.export(self, nb_path, export_path, pdf, filtering, pagebreaks, files, display_link, force_save, run_tests)
    401 if run_tests:
    402     print("Running your submission against local test cases...\n")
--> 403     results = grade_zip_file(zip_path, nb_path, self._path)
    404     print(
    405         "Your submission received the following results when run against " + \
    406         "available test cases:\n\n" + indent(results.summary(), "    "))
    408 if display_link:
    409     # create and display output HTML

File ~/.conda/envs/jup/lib/python3.11/site-packages/otter/check/utils.py:85, in grade_zip_file(zip_path, nb_arcname, tests_dir)
     82 print(results.stderr.decode("utf-8"))
     84 if results.stderr:
---> 85     raise RuntimeError(results.stderr)
     87 with open(results_path, "rb") as f:
     88     results = dill.load(f)

RuntimeError: b'0.00s - Debugger warning: It seems that frozen modules are being used, which may\n0.00s - make the debugger miss breakpoints. Please pass -Xfrozen_modules=off\n0.00s - to python to disable frozen modules.\n0.00s - Note: Debugging will proceed. Set PYDEVD_DISABLE_FILE_VALIDATION=1 to disable this validation.\n0.00s - Debugger warning: It seems that frozen modules are being used, which may\n0.00s - make the debugger miss breakpoints. Please pass -Xfrozen_modules=off\n0.00s - to python to disable frozen modules.\n0.00s - Note: Debugging will proceed. Set PYDEVD_DISABLE_FILE_VALIDATION=1 to disable this validation.\n'

To Reproduce
Create a simple notebook with a question that has a test, like so:

{
 "cells": [
  {
   "cell_type": "raw",
   "id": "674ecf9b",
   "metadata": {},
   "source": [
    "# ASSIGNMENT CONFIG\n",
    "export_cell:\n",
    "    pdf: false"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "7b205b0b",
   "metadata": {},
   "source": [
    "# Example Test"
   ]
  },
  {
   "cell_type": "raw",
   "id": "ac2958b0",
   "metadata": {},
   "source": [
    "# BEGIN QUESTION\n",
    "name: q1"
   ]
  },
  {
   "cell_type": "raw",
   "id": "1fdf7774",
   "metadata": {},
   "source": [
    "# BEGIN SOLUTION"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "9f18a9ca",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "hello world\n"
     ]
    }
   ],
   "source": [
    "print('hello world')"
   ]
  },
  {
   "cell_type": "raw",
   "id": "48d1ffa3",
   "metadata": {},
   "source": [
    "# END SOLUTION"
   ]
  },
  {
   "cell_type": "raw",
   "id": "5b509cca",
   "metadata": {},
   "source": [
    "# BEGIN TESTS"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "a5ad319f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "True"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "True"
   ]
  },
  {
   "cell_type": "raw",
   "id": "d7690fb8",
   "metadata": {},
   "source": [
    "# END TESTS"
   ]
  },
  {
   "cell_type": "raw",
   "id": "a60f8819",
   "metadata": {},
   "source": [
    "# END QUESTION"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.11.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}

Then, use otter assign to generate the student version of the notebook. Upon running all of the cells in the student version of the notebook, the aforementioned error occurs.

Expected behavior
The notebook exports properly, with no error.

Versions
Python 3.11.4, otter-grader 5.0.2

@bdsomer bdsomer added the bug Something isn't working label Aug 1, 2023
bdsomer added a commit to bdsomer/otter-grader that referenced this issue Aug 1, 2023
@chrispyles chrispyles added this to the v5.1.0 milestone Aug 4, 2023
bdsomer added a commit to bdsomer/otter-grader that referenced this issue Aug 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants