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

Fixing np.logical_and/or problems in Connection ProcessModels #412

Merged
merged 3 commits into from Oct 14, 2022

Conversation

gkarray
Copy link
Contributor

@gkarray gkarray commented Oct 13, 2022

Issue Number: #411

Objective of pull request: Fixing incorrect use of np.logical_and and np.logical_or was discovered in learning-related code in Connection ProcessModels.

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?

  • Currently, to implement and and or element-wise operations on 3 np.ndarray (example : a, b and c), the following is used :
    np.logical_and(a, b, c)

What is the new behavior?

  • Replaced it with :
    a & b & c

Does this introduce a breaking change?

  • Yes
  • No

@gkarray gkarray self-assigned this Oct 13, 2022
Copy link
Contributor

@PhilippPlank PhilippPlank left a comment

Choose a reason for hiding this comment

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

This should work and is faster and as long as the arrays are only boolean it is the same behavior.

@PhilippPlank PhilippPlank merged commit be6e557 into main Oct 14, 2022
@tim-shea tim-shea added this to the Release 0.5.1 milestone Oct 25, 2022
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.

None yet

4 participants