-
Notifications
You must be signed in to change notification settings - Fork 151
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
base: main
Are you sure you want to change the base?
Conversation
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.
Thanks, I'm fine with the basic mechanism for now.
However, it would be nice to beautify it a bit more:
- Please come up with a better name for enable_win. Sounds very hack'ish. It should probably also not be in the in_depth directory if it's needed for any tutorial. Probably should go into utils?
- Please rework this statement:
"This is not part of the tutorial or Lava, but to allow this jupyter notebook to execute on Windows without errors. The class LIF and PyLifModel need to be imported from a script in order to run this tutorial on Windows due to an issue with the multiprocessing package on Windows."
-> You say it's not part of the tutorial, yet is all written within a Lava tutorial. Just give a bit of a cleaner explanation as to why such a hack is necessary and that we'll look into fixing this in the future.
-> Text says LIF AND PyLifModel need to be imported but you only import LIF - Can you think of a way to hide all this import business? Would it be possible to just have a single function to which you pass the class of function name of a class of function defined in a tutorial. It then detects the local file it is defined in, exports it, and reimports it into the global namespace?
tutorials/in_depth/win_exec.py
Outdated
import os | ||
|
||
|
||
def enable_win(nb_name: str): |
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.
tutorials/in_depth/win_exec.py
Outdated
|
||
|
||
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 comment
The reason will be displayed to describe this comment to others. Learn more.
Please give better justification for this workaround.
Provide a bit of context why such a strange hack is necessary. If people are not just told what is done by why it is done, it's easier to "accept".
I realized that the solution only works for tutorial 02, for the other tutorials things get more complex because Processes get overwritten. There is some cleanup necessary, but @awintel, could you please take a look at this updated solution? |
Issue Number: #95 and #148
Objective of pull request: All tutorials should work on Windows systems
Pull request checklist
Your PR fulfills the following requirements:
flakeheaven lint src/lava tests/
) and (bandit -r src/lava/.
) pass locallypytest
) passes locallyPull request type
Please check your PR type:
What is the current behavior?
What is the new behavior?
Does this introduce a breaking change?