colab: make setup cell more robust#498
Conversation
|
This PR makes the Colab setup detection more robust and avoids re-cloning on reruns. Happy to adjust to preferred style. |
|
Hello @Masood-Akram, Thank you for your contribution. This improves the original code:
What is the motivation for the dedicated If the above code is acceptable to you over the usage of |
|
Thanks for the review. I added _in_colab() mainly to keep the Colab detection logic separate from the setup steps (readability and easier reuse across notebooks). That said, I agree the inline try/except approach you suggested is simpler and consistent with the style in the repo. I can update the PR to use your direct approach. |
The notebook repository does not use flake8_nb for linting, so removed the noqa directive which is identified as a spelling mistake by our spellchecker.
|
@Masood-Akram Thank you for the contribution. Merging and will propagate to the other notebooks that support colab. |
|
@zivy Happy to contribute to this repository. |
|
@Masood-Akram, just an FYI, I propagated this change to all the notebooks that use colab and listed you as co-author (PR #499). |
|
@zivy Thank you very much. |
Improved Colab detection and made the clone step idempotent (won’t reclone on rerun).
Prevents false negatives and improves notebook re-runnability in Colab.