Skip to content

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

Merged
PhilippPlank merged 3 commits intomainfrom
learning_np_logical_fix
Oct 14, 2022
Merged

Fixing np.logical_and/or problems in Connection ProcessModels#412
PhilippPlank merged 3 commits intomainfrom
learning_np_logical_fix

Conversation

@gkarray
Copy link
Copy Markdown
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 requested review from bala-git9 and weidel-p October 13, 2022 11:32
@gkarray gkarray self-assigned this Oct 13, 2022
Copy link
Copy Markdown
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
monkin77 pushed a commit to monkin77/thesis-lava that referenced this pull request Jul 12, 2024
…c#412)

* fixing np.logical_and/or problems

* fixing linting issues

Co-authored-by: gkarray <[email protected]>
Co-authored-by: PhilippPlank <[email protected]>
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.

4 participants