Fix syntax errors in Colab environment patch#24
Conversation
|
This fix is necessary because Google Colab's recent update to NumPy 2.0 breaks the existing AF-Cluster logic (specifically the use of np.NaN). Since the original patch cell had syntax errors, it was failing to downgrade NumPy, leaving the notebook in a broken state for all users. |
There was a problem hiding this comment.
Pull request overview
This PR updates the Colab notebook patch cell intended to work around a Google Colab / NumPy compatibility break by ensuring the downgrade commands execute correctly.
Changes:
- Fixes syntax/formatting issues in the NumPy downgrade cell (
pip uninstallquoting andos.getpid()call). - Updates the “Open in Colab” badge URL in the notebook header.
- Cleans some notebook metadata (e.g.,
execution_countset tonull, removescellViewin one cell).
Comments suppressed due to low confidence (1)
AF_cluster_in_colabdesign.ipynb:67
- This cell’s metadata no longer includes "cellView": "form" while other parameterized/form cells in the notebook still do. If you want this “run first” patch cell to render consistently in Colab’s form view (and stay collapsed/organized), consider keeping the cellView metadata here as well.
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "3TEmlVAmCznf",
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| }, | ||
| "source": [ | ||
| "<a href=\"https://colab.research.google.com/github/HWaymentSteele/AF_Cluster/blob/main/AF_cluster_in_colabdesign.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>" | ||
| "<a href=\"https://colab.research.google.com/github/ywchanna2001/AF_Cluster/blob/fix-colab-numpy-bug/AF_cluster_in_colabdesign.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>" |
There was a problem hiding this comment.
The “Open in Colab” badge now links to a fork/feature branch (ywchanna2001/.../fix-colab-numpy-bug). If this notebook is intended to be used from the upstream repo, the badge should point to the canonical repository/branch (typically HWaymentSteele/AF_Cluster on main) to avoid broken links once the branch is deleted or the fork diverges.
Fixed an extra quote in the pip uninstall command and a space in the os.getpid() call that prevented the NumPy downgrade from executing.