-
Notifications
You must be signed in to change notification settings - Fork 144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable tutorials on Windows #259
Draft
PhilippPlank
wants to merge
50
commits into
lava-nc:main
Choose a base branch
from
PhilippPlank:tutorial_win_fix
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 47 commits
Commits
Show all changes
50 commits
Select commit
Hold shift + click to select a range
f456afb
- Initial enablement of RefPort and VarPorts
PhilippPlank 2d0ec74
- Initial enablement of RefPort and VarPorts
PhilippPlank 25a3a68
- Initial enablement of RefPort and VarPorts
PhilippPlank a2d1765
- Initial enablement of RefPort and VarPorts
PhilippPlank 74dfdf6
Merge branch 'lava-nc:main' into main
PhilippPlank 1daa9af
- Enablement of RefPorts and VarPorts - addressed change requests fro…
PhilippPlank 5908401
- Enablement of RefPorts and VarPorts - addressed change requests fro…
PhilippPlank 3df2847
- Enablement of RefPorts and VarPorts - addressed change requests fro…
PhilippPlank 9581fae
Merge branch 'lava-nc:main' into main
PhilippPlank 6e4716a
- Enablement of RefPorts and VarPorts - addressed change requests fro…
PhilippPlank e22def6
Merge branch 'lava-nc:main' into main
PhilippPlank bd25a80
Merge branch 'lava-nc:main' into main
PhilippPlank 7edeb1f
Merge branch 'lava-nc:main' into main
PhilippPlank 23fb8d7
Merge branch 'lava-nc:main' into main
PhilippPlank f6686b4
Merge branch 'lava-nc:main' into main
PhilippPlank 86867c2
Merge branch 'lava-nc:main' into main
PhilippPlank 859a195
Merge branch 'lava-nc:main' into main
PhilippPlank f7007f8
Merge branch 'lava-nc:main' into main
PhilippPlank 0163202
Merge branch 'lava-nc:main' into main
PhilippPlank bf934ef
modified connection tutorial for release 0.2.0
PhilippPlank 0eef67e
Merge branch 'lava-nc:main' into main
PhilippPlank f08a35c
fixed typos
PhilippPlank ceddf2a
Merge branch 'lava-nc:main' into main
PhilippPlank f798b0a
Merge branch 'lava-nc:main' into main
PhilippPlank b6e72bb
Merge branch 'lava-nc:main' into main
PhilippPlank 9c57309
Merge branch 'lava-nc:main' into main
PhilippPlank 7425f7e
Merge branch 'lava-nc:main' into main
PhilippPlank bc353c7
Merge branch 'lava-nc:main' into main
PhilippPlank 73288a4
Merge branch 'lava-nc:main' into main
PhilippPlank 3f5c2d7
Merge branch 'lava-nc:main' into main
PhilippPlank e691b1d
Merge branch 'lava-nc:main' into main
PhilippPlank 9ab9a5d
Merge branch 'lava-nc:main' into main
PhilippPlank a1f0367
Merge branch 'lava-nc:main' into main
PhilippPlank 50f9113
Merge branch 'lava-nc:main' into main
PhilippPlank e2342f5
Merge branch 'lava-nc:main' into main
PhilippPlank 0b7cedb
Merge branch 'lava-nc:main' into main
PhilippPlank 6a30ad7
Merge branch 'lava-nc:main' into main
PhilippPlank 8e652bc
Merge branch 'lava-nc:main' into main
PhilippPlank 3b3cc6f
Merge branch 'lava-nc:main' into main
PhilippPlank 46b54ad
Merge branch 'lava-nc:main' into main
PhilippPlank 0c02489
Merge branch 'lava-nc:main' into main
PhilippPlank 01d9097
Merge branch 'lava-nc:main' into main
PhilippPlank efc0bd4
Merge branch 'lava-nc:main' into main
PhilippPlank 976c5d2
Merge branch 'lava-nc:main' into main
PhilippPlank e4c54c2
Merge branch 'lava-nc:main' into main
PhilippPlank f881ef2
Merge branch 'lava-nc:main' into tutorial_win_fix
PhilippPlank be9aa26
Windows fix for tutorials - draft
PhilippPlank b89d6f1
moved win_exec.py to utils and changed text
weidel-p b397080
used magic to export single cells instead of complete script
weidel-p 771ae85
lint
weidel-p File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Copyright (C) 2022 Intel Corporation | ||
# SPDX-License-Identifier: BSD-3-Clause | ||
# See: https://spdx.org/licenses/ | ||
|
||
from sys import platform | ||
import os | ||
|
||
|
||
def enable_win(nb_name: str): | ||
"""Enables execution of Lava tutorials on Windows systems. Processes | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please give better justification for this workaround. |
||
defined within the tutorial jupyter notebook need to be written to a python | ||
script and imported in the notebook again.""" | ||
if platform == "win32" or platform == "cygwin": | ||
# Convert the ipython notebook to a python script | ||
os.system("jupyter nbconvert --to script " + nb_name + ".ipynb") | ||
|
||
# Remove code after definition to avoid execution during import | ||
with open(nb_name + ".py", "r+") as f: | ||
d = f.readlines() | ||
f.seek(0) | ||
for i in d: | ||
if i.strip("\n") != "# #### Exception for Windows": | ||
f.write(i) | ||
elif i.strip("\n") == "# #### Exception for Windows": | ||
break | ||
f.truncate() | ||
|
||
|
||
def cleanup(nb_name: str): | ||
"""Removes previously created python script for tutorial execution on | ||
Windows systems.""" | ||
if platform == "win32" or platform == "cygwin": | ||
os.system("del " + nb_name + ".py") | ||
|
||
|
||
if __name__ == "__main__": | ||
pass |
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.
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.
Please come up with a better name.