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

Add loglevel to PyLoihiProcessModel.__init__ #761

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tim-shea
Copy link
Contributor

@tim-shea tim-shea commented Aug 1, 2023

Issue Number: #760

Objective of pull request: Add loglevel paramater to PyLoihiProcessModel constructor

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

What is the current behavior?

  • User cannot override the default loglevel of a PyLoihiProcessModel.

What is the new behavior?

  • User can provide a loglevel parameter to the PyLoihiProcessModel constructor which will be forwarded to the AbstractPyProcessModel constructor, leading to a different loglevel being set for the process model log.

Does this introduce a breaking change?

  • No

@tim-shea tim-shea linked an issue Aug 1, 2023 that may be closed by this pull request
@tim-shea tim-shea self-assigned this Aug 1, 2023
@tim-shea tim-shea added this to the Lava v0.8.1 milestone Aug 1, 2023
def __init__(self, proc_params: ty.Optional["ProcessParameters"] = None):
super().__init__(proc_params=proc_params)
def __init__(self, proc_params: ty.Optional["ProcessParameters"] = None,
loglevel: ty.Optional[int] = logging.WARNING):
Copy link
Contributor

@bamsumit bamsumit Aug 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this complete? Don't we need to flow the loglevel when creating instances of processmodels during compilation?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we? I'm really not sure. I got frustrated when I realized how entangled the loglevel stuff is throughout a million different places and gave up. I guess we could just close this as it's not really very important.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PyLoihiProcessModel does not accept a LogLevel parameter.
2 participants