-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Conversation
Remove !pip install and git clone commands from the preamble cells of all cookbook notebooks. These bash executions are unnecessary for local development and can cause issues in various environments. The notebooks now use a simple Python-based approach to handle the directory structure when running from the repo root. Fixes PyPortfolio#717 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
wavebyrd
commented
Mar 16, 2026
Author
Ping on this notebook cleanup - removes bash execution from cookbook. Ready for review!
@atharvajoshi01
atharvajoshi01
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good security hygiene. Removing the shell execution (!pip install and os.system("git clone")) from notebooks prevents accidental code execution when someone opens these in Jupyter. The replacement with a simple os.chdir check is clean.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
!pip installcommands from all 5 cookbook notebooksgit cloneandos.chdir()commands that were used for Colab/Kaggle setupChanges
All 5 notebooks updated:
1-RiskReturnModels.ipynb2-Mean-Variance-Optimisation.ipynb3-Advanced-Mean-Variance-Optimisation.ipynb4-Black-Litterman-Allocation.ipynb5-Hierarchical-Risk-Parity.ipynbThe preamble cell now just handles the directory structure:
Test plan
!pip,!git,%%bash)Fixes #717
🤖 Generated with Claude Code