Skip to content

Commit

Permalink
fix links
Browse files Browse the repository at this point in the history
  • Loading branch information
lillianw101 committed Jan 26, 2024
1 parent c1e9b85 commit ec4b0ca
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions autograder_gradescope/autograder_gradescope.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,16 @@ The best course of action is to find the test case that failed and use that as a
<center><img src = "autograder_error_annot.png" width = "700"></img></a></center>

### Why do I get an error saying "`grader is not defined`"?
If it has been a while since you’ve worked on an assignment, the kernel will shut itself down to preserve memory. When this happens, all of your variables are forgotten, including the grader. That’s OK. The easiest way to fix this is by [restarting your kernel and rerunning all the cells](https://ds100.org/debugging-guide/jupyter_shortcuts/jupyter_shortcuts.html#restarting-kernel). To do this, in the top left menu, click `Kernel` -> `Restart and Run All Cells`.
If it has been a while since you’ve worked on an assignment, the kernel will shut itself down to preserve memory. When this happens, all of your variables are forgotten, including the grader. That’s OK. The easiest way to fix this is by [restarting your kernel and rerunning all the cells](https://ds100.org/debugging-guide/jupyter101/jupyter101.html#restarting-kernel). To do this, in the top left menu, click `Kernel` -> `Restart and Run All Cells`.

### I’m positive I have the right answer, but the test fails. Is there a mistake in the test?
While you might see the correct answer displayed as the result of the cell, chances are your solution isn’t being stored in the answer variable. Make sure you are assigning the result to the answer variable and that there are no typos in the variable name. Finally, [restart your kernel and run all the cells in order](https://ds100.org/debugging-guide/jupyter_shortcuts/jupyter_shortcuts.html#restarting-kernel): `Kernel` -> `Restart and Run All Cells`.
While you might see the correct answer displayed as the result of the cell, chances are your solution isn’t being stored in the answer variable. Make sure you are assigning the result to the answer variable and that there are no typos in the variable name. Finally, [restart your kernel and run all the cells in order](https://ds100.org/debugging-guide/jupyter101/jupyter101.html#restarting-kernel): `Kernel` -> `Restart and Run All Cells`.

### Why does `grader.export(run_tests=True)` fail if all previous tests passed?
This can happen if you “overwrite” a variable that is used in a question. For instance, say Question 1 asks you to store your answer in a variable named `stat` and, later on in the notebook, you change the value of `stat`; the test right after Question 1 will pass, but the test at the end of the notebook will fail. It is good programming practice to give your variables informative names and to avoid repeating the same variable name for more than one purpose.

### Why does a notebook test fail now when it passed before, and I didn’t change my code?
You probably ran your notebook out of order. [Re-run all previous cells](https://ds100.org/debugging-guide/jupyter_shortcuts/jupyter_shortcuts.html#running-cells) in order, which is how your code will be graded.
You probably ran your notebook out of order. [Re-run all previous cells](https://ds100.org/debugging-guide/jupyter101/jupyter101.html#running-cells) in order, which is how your code will be graded.

### I accidentally deleted something in a cell that was provided to me – how do I get it back?
Suppose you’re working on Lab 5. One solution is to go directly to DataHub and rename your lab05 folder to something else, like lab05-old. Then, click the Lab 5 link on the course website again, and it’ll bring you to a brand-new version of Lab 5. You can then copy your work from your old Lab 5 to this new one, which should have the original version of the assignment.
Expand Down
Binary file modified docs/Data-100-Debugging-Guide.pdf
Binary file not shown.
6 changes: 3 additions & 3 deletions docs/autograder_gradescope/autograder_gradescope.html
Original file line number Diff line number Diff line change
Expand Up @@ -206,19 +206,19 @@ <h3 class="anchored" data-anchor-id="understanding-autograder-error-messages">Un
</section>
<section id="why-do-i-get-an-error-saying-grader-is-not-defined" class="level3">
<h3 class="anchored" data-anchor-id="why-do-i-get-an-error-saying-grader-is-not-defined">Why do I get an error saying “<code>grader is not defined</code>”?</h3>
<p>If it has been a while since you’ve worked on an assignment, the kernel will shut itself down to preserve memory. When this happens, all of your variables are forgotten, including the grader. That’s OK. The easiest way to fix this is by <a href="https://ds100.org/debugging-guide/jupyter_shortcuts/jupyter_shortcuts.html#restarting-kernel">restarting your kernel and rerunning all the cells</a>. To do this, in the top left menu, click <code>Kernel</code> -&gt; <code>Restart and Run All Cells</code>.</p>
<p>If it has been a while since you’ve worked on an assignment, the kernel will shut itself down to preserve memory. When this happens, all of your variables are forgotten, including the grader. That’s OK. The easiest way to fix this is by <a href="https://ds100.org/debugging-guide/jupyter101/jupyter101.html#restarting-kernel">restarting your kernel and rerunning all the cells</a>. To do this, in the top left menu, click <code>Kernel</code> -&gt; <code>Restart and Run All Cells</code>.</p>
</section>
<section id="im-positive-i-have-the-right-answer-but-the-test-fails.-is-there-a-mistake-in-the-test" class="level3">
<h3 class="anchored" data-anchor-id="im-positive-i-have-the-right-answer-but-the-test-fails.-is-there-a-mistake-in-the-test">I’m positive I have the right answer, but the test fails. Is there a mistake in the test?</h3>
<p>While you might see the correct answer displayed as the result of the cell, chances are your solution isn’t being stored in the answer variable. Make sure you are assigning the result to the answer variable and that there are no typos in the variable name. Finally, <a href="https://ds100.org/debugging-guide/jupyter_shortcuts/jupyter_shortcuts.html#restarting-kernel">restart your kernel and run all the cells in order</a>: <code>Kernel</code> -&gt; <code>Restart and Run All Cells</code>.</p>
<p>While you might see the correct answer displayed as the result of the cell, chances are your solution isn’t being stored in the answer variable. Make sure you are assigning the result to the answer variable and that there are no typos in the variable name. Finally, <a href="https://ds100.org/debugging-guide/jupyter101/jupyter101.html#restarting-kernel">restart your kernel and run all the cells in order</a>: <code>Kernel</code> -&gt; <code>Restart and Run All Cells</code>.</p>
</section>
<section id="why-does-grader.exportrun_teststrue-fail-if-all-previous-tests-passed" class="level3">
<h3 class="anchored" data-anchor-id="why-does-grader.exportrun_teststrue-fail-if-all-previous-tests-passed">Why does <code>grader.export(run_tests=True)</code> fail if all previous tests passed?</h3>
<p>This can happen if you “overwrite” a variable that is used in a question. For instance, say Question 1 asks you to store your answer in a variable named <code>stat</code> and, later on in the notebook, you change the value of <code>stat</code>; the test right after Question 1 will pass, but the test at the end of the notebook will fail. It is good programming practice to give your variables informative names and to avoid repeating the same variable name for more than one purpose.</p>
</section>
<section id="why-does-a-notebook-test-fail-now-when-it-passed-before-and-i-didnt-change-my-code" class="level3">
<h3 class="anchored" data-anchor-id="why-does-a-notebook-test-fail-now-when-it-passed-before-and-i-didnt-change-my-code">Why does a notebook test fail now when it passed before, and I didn’t change my code?</h3>
<p>You probably ran your notebook out of order. <a href="https://ds100.org/debugging-guide/jupyter_shortcuts/jupyter_shortcuts.html#running-cells">Re-run all previous cells</a> in order, which is how your code will be graded.</p>
<p>You probably ran your notebook out of order. <a href="https://ds100.org/debugging-guide/jupyter101/jupyter101.html#running-cells">Re-run all previous cells</a> in order, which is how your code will be graded.</p>
</section>
<section id="i-accidentally-deleted-something-in-a-cell-that-was-provided-to-me-how-do-i-get-it-back" class="level3">
<h3 class="anchored" data-anchor-id="i-accidentally-deleted-something-in-a-cell-that-was-provided-to-me-how-do-i-get-it-back">I accidentally deleted something in a cell that was provided to me – how do I get it back?</h3>
Expand Down
2 changes: 1 addition & 1 deletion docs/jupyter_datahub/jupyter_datahub.html
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ <h2 class="anchored" data-anchor-id="my-kernel-died-restarted-or-is-very-slow">M
<li><a href="https://ds100.org/debugging-guide/jupyter101/jupyter101.html#restarting-kernel">Restart your kernel</a></li>
<li><a href="https://ds100.org/debugging-guide/jupyter101/jupyter101.html#running-cells">Rerun your cells</a></li>
</ol>
<p>Note that you may loose some recent work if your kernel restarted when you were in the middle of editing a cell. As such, we recommend <a href="https://ds100.org/debugging-guide/jupyter101/jupyter101.html/saving-your-notebook">saving your work</a> as often as possible.</p>
<p>Note that you may loose some recent work if your kernel restarted when you were in the middle of editing a cell. As such, we recommend <a href="https://ds100.org/debugging-guide/jupyter101/jupyter101.html#saving-your-notebook">saving your work</a> as often as possible.</p>
<p>If this does not fix the issue, it could be a problem with your code, usually the last cell that executed before your kernel crashed. Double check your logic, and feel free to make a private post on Ed if you’re stuck!</p>
</section>
<section id="i-cant-edit-a-cell" class="level2">
Expand Down
4 changes: 2 additions & 2 deletions docs/pandas/pandas.html
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ <h2 class="anchored" data-anchor-id="understanding-pandas-errors">Understanding
<h2 class="anchored" data-anchor-id="my-code-is-taking-a-really-long-time-to-run">My code is taking a really long time to run</h2>
<p>It is normal for a cell to take a few seconds – sometimes a few minutes – to run. If it’s is taking too long, however, you have several options:</p>
<ol type="1">
<li>Try restarting the kernel. Sometimes, Datahub glitches or lags, causing the code to run slower than expected. <a href="https://ds100.org/debugging-guide/jupyter_shortcuts/jupyter_shortcuts.html#restarting-kernel">Restarting the kernel</a> should fix this problem, but if the cell is still taking a while to run, it is likely a problem with your code.</li>
<li>Try restarting the kernel. Sometimes, Datahub glitches or lags, causing the code to run slower than expected. <a href="https://ds100.org/debugging-guide/jupyter101/jupyter101.html#restarting-kernel">Restarting the kernel</a> should fix this problem, but if the cell is still taking a while to run, it is likely a problem with your code.</li>
<li>Scrutinize your code. Am I using too many for loops? Is there a repeated operation that I can substitute with a <code>pandas</code> function?</li>
</ol>
</section>
Expand All @@ -225,7 +225,7 @@ <h3 class="anchored" data-anchor-id="typeerror-___-object-is-not-callable"><code
<p>This often happens when you use a default keyword (like <code>str</code>, <code>list</code>, <code>range</code>, <code>sum</code>, or <code>max</code>) as a variable name, for instance:</p>
<pre><code>sum = 1 + 2 + 3</code></pre>
<p>These errors can be tricky because they don’t error on their own but cause problems when we try to use the name <code>sum</code> (for example) later on in the notebook.</p>
<p>To fix the issue, identify any such lines of code, change your variable names to be something more informative, and <a href="https://ds100.org/debugging-guide/jupyter_shortcuts/jupyter_shortcuts.html#restarting-kernel">restart your notebook</a>.</p>
<p>To fix the issue, identify any such lines of code, change your variable names to be something more informative, and <a href="https://ds100.org/debugging-guide/jupyter101/jupyter101.html#restarting-kernel">restart your notebook</a>.</p>
<p>Python keywords like <code>str</code> and <code>list</code> appear in green text, so be on the lookout if any of your variable names appear in green!</p>
</section>
<section id="typeerror-could-not-convert-string-to-a-float" class="level3">
Expand Down
2 changes: 1 addition & 1 deletion jupyter_datahub/jupyter_datahub.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ When you see a message like this:
2. [Restart your kernel](https://ds100.org/debugging-guide/jupyter101/jupyter101.html#restarting-kernel)
3. [Rerun your cells](https://ds100.org/debugging-guide/jupyter101/jupyter101.html#running-cells)

Note that you may loose some recent work if your kernel restarted when you were in the middle of editing a cell. As such, we recommend [saving your work](https://ds100.org/debugging-guide/jupyter101/jupyter101.html/saving-your-notebook) as often as possible.
Note that you may loose some recent work if your kernel restarted when you were in the middle of editing a cell. As such, we recommend [saving your work](https://ds100.org/debugging-guide/jupyter101/jupyter101.html#saving-your-notebook) as often as possible.

If this does not fix the issue, it could be a problem with your code, usually the last cell that executed before your kernel crashed. Double check your logic, and feel free to make a private post on Ed if you're stuck!

Expand Down
4 changes: 2 additions & 2 deletions pandas/pandas.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ This note is (mostly) structured around the error messages that show up at the b
## My code is taking a really long time to run
It is normal for a cell to take a few seconds -- sometimes a few minutes -- to run. If it's is taking too long, however, you have several options:

1. Try restarting the kernel. Sometimes, Datahub glitches or lags, causing the code to run slower than expected. [Restarting the kernel](https://ds100.org/debugging-guide/jupyter_shortcuts/jupyter_shortcuts.html#restarting-kernel) should fix this problem, but if the cell is still taking a while to run, it is likely a problem with your code.
1. Try restarting the kernel. Sometimes, Datahub glitches or lags, causing the code to run slower than expected. [Restarting the kernel](https://ds100.org/debugging-guide/jupyter101/jupyter101.html#restarting-kernel) should fix this problem, but if the cell is still taking a while to run, it is likely a problem with your code.
2. Scrutinize your code. Am I using too many for loops? Is there a repeated operation that I can substitute with a `pandas` function?

## Why is it generally better avoid using loops or list comprehensions when possible?
Expand All @@ -44,7 +44,7 @@ This often happens when you use a default keyword (like `str`, `list`, `range`,

These errors can be tricky because they don’t error on their own but cause problems when we try to use the name `sum` (for example) later on in the notebook.

To fix the issue, identify any such lines of code, change your variable names to be something more informative, and [restart your notebook](https://ds100.org/debugging-guide/jupyter_shortcuts/jupyter_shortcuts.html#restarting-kernel).
To fix the issue, identify any such lines of code, change your variable names to be something more informative, and [restart your notebook](https://ds100.org/debugging-guide/jupyter101/jupyter101.html#restarting-kernel).

Python keywords like `str` and `list` appear in green text, so be on the lookout if any of your variable names appear in green!

Expand Down

0 comments on commit ec4b0ca

Please sign in to comment.