byuccl / digital_design_colab

Digital Design Colab Examples
5 stars 2 forks source link

Github says notebook is invalid. Works on Notebooks #55

Open Zach227 opened 1 year ago

Zach227 commented 1 year ago

Simulation Tutorial

Github states that the notebook is invalid. Though the link we have still opens the notebook just fine with Google Colabs. What causes this discrepancy?

Zach227 commented 1 year ago

Some cells in the notebook have duplicated information. For example:

Bad Cell Good Cell
```json { "cell_type": "code", "execution_count": 4, "metadata": { "cellView": "form", "id": "DX4MhsQZuZ1k" }, "outputs": [], "source": [ "#@title Install Verilator\n", "!apt-get install verilator >/dev/null" ], "metadata": { "id": "DX4MhsQZuZ1k", "cellView": "form" }, "execution_count": 5, "outputs": [] }, ``` ```json { "cell_type": "code", "execution_count": 4, "metadata": { "cellView": "form", "id": "DX4MhsQZuZ1k" }, "outputs": [], "source": [ "#@title Install Verilator\n", "!apt-get install verilator >/dev/null" ] }, ```

When VS Code or Github tries to render this they get confused and says it is invalid. But when the notebook is loaded into Google Colabs it clears the duplicate data and the notebook works properly. This must have happened when somebody ran the notebook and then downloaded the .ipynb file without clearing everything first. To fix this open the notebook in Google Colabs and then save a copy to your drive. Open the copied notebook and make sure all outputs are cleared, code is covered by forms, and sections are collapsed. Then download the notebook as .ipynb without running anything in the notebook. Replace the bugged version with your newly download version commit to github.