chore(docs): cleanup pip install
in notebooks
#471
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.
Description
A clear and concise description of what this pull request does.
Hello! While this wasn't any big issue, I think that using
os.system("pip install sionna")
isgenerally a bad idea,
especially as it can be problematic for people with
multiple virtual environments or Jupyter kernels.
Indeed, calling
pip
does not always point to the right Python environment.Moreover, your "check" to see if Sionna is installed imports
os
a second time,which is not needed I guess (so replacing it with
import sys
should be fine).Hence, it is better to refer to
sys.executable
, which points to the currentPython executable. Additionally, using the
!
syntax feels more naturalinside Jupyter Notebooks.
To perform a bulk search-and-replace, I used
ripgrep
to identify all the files,and the following Python script to perform the actual edits:
Moreover, I manually edited the second
pip install sionna
in
Sionna_tutorial_part4.ipynb
so that it is not ran (because there is already oneat the top of the document).
I hope that you don't mind this PR that comes a bit out of nowhere :-)
Checklist
[ ] Added references to issues and discussions[ ] Added / modified unit tests as needed[ ] Passes all tests[ ] Lint the code[ ] Co-authored with someone? Add Co-authored-by: user@domain and ensure they signed off their commits too.