Skip to content

fix: correct bernoulli_loader kwarg, remove duplicate import, fix mutable default#743

Open
haoyu-haoyu wants to merge 1 commit intoBindsNET:masterfrom
haoyu-haoyu:fix/code-quality-bugs
Open

fix: correct bernoulli_loader kwarg, remove duplicate import, fix mutable default#743
haoyu-haoyu wants to merge 1 commit intoBindsNET:masterfrom
haoyu-haoyu:fix/code-quality-bugs

Conversation

@haoyu-haoyu
Copy link
Copy Markdown

Summary

  • Fix bernoulli_loader reading wrong kwarg in bindsnet/encoding/loaders.py: kwargs.get("dt", 1.0) should be kwargs.get("max_prob", 1.0). The docstring documents max_prob as the parameter for maximum spike probability per Bernoulli trial, but the code was reading dt instead.

  • Remove duplicate import numpy as np in bindsnet/network/monitors.py.

  • Fix mutable default argument pipeline: list = []pipeline: Optional[list] = None in MulticompartmentConnection.__init__ (bindsnet/network/topology.py). Mutable defaults are shared across all instances.

Test plan

  • bernoulli_loader now correctly reads max_prob parameter
  • No behavioral change for existing code that doesn't pass max_prob (default remains 1.0)
  • Existing tests should pass without modification

…able default

- Fix bernoulli_loader reading 'dt' instead of 'max_prob' from kwargs
  in encoding/loaders.py. The docstring documents max_prob but the
  code was fetching the wrong key.

- Remove duplicate 'import numpy as np' in network/monitors.py.

- Fix mutable default argument pipeline=[] in
  MulticompartmentConnection.__init__. Changed to None with guard.
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.

1 participant