Skip to content
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
wants to merge 50 commits into
base: main
Choose a base branch
from

Conversation

PhilippPlank
Copy link
Contributor

@PhilippPlank PhilippPlank commented Jun 14, 2022

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:

  • Issue created that explains the change and why it's needed
  • Tests are part of the PR (for bug fixes / features)
  • Docs reviewed and added / updated if needed (for bug fixes / features)
  • PR conforms to Coding Conventions
  • PR applys BSD 3-clause or LGPL2.1+ Licenses to all code files
  • Lint (flakeheaven lint src/lava tests/) and (bandit -r src/lava/.) pass locally
  • Build tests (pytest) passes locally

Pull request type

Please check your PR type:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation changes
  • Other (please describe):

What is the current behavior?

  • The tutorial execution stalls

What is the new behavior?

  • The tutorial executes all cells as expected

Does this introduce a breaking change?

  • Yes
  • No

PhilippPlank and others added 30 commits November 12, 2021 14:53
@PhilippPlank PhilippPlank self-assigned this Jun 14, 2022
@PhilippPlank PhilippPlank added the 1-bug Something isn't working label Jun 14, 2022
Copy link
Contributor

@awintel awintel left a 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?

import os


def enable_win(nb_name: str):
Copy link
Contributor

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.



def enable_win(nb_name: str):
"""Enables execution of Lava tutorials on Windows systems. Processes
Copy link
Contributor

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".

@weidel-p
Copy link
Contributor

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1-bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants