Skip to content

Commit

Permalink
fix: black and isort
Browse files Browse the repository at this point in the history
  • Loading branch information
drodarie committed Sep 18, 2024
1 parent 93da6bf commit 026c5b3
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![Build Status](https://github.com/dbbs-lab/bsb-nest/actions/workflows/build.yml/badge.svg)](https://github.com/dbbs-lab/bsb-nest/actions/workflows/build.yml)
[![Build Status](https://github.com/dbbs-lab/bsb-nest/actions/workflows/main.yml/badge.svg)](https://github.com/dbbs-lab/bsb-nest/actions/workflows/main.yml)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)

# bsb-nest
Expand Down
11 changes: 7 additions & 4 deletions bsb_nest/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,13 @@ def connect_to_nodes(self, device, nodes):
else:
try:
nest.Connect(
device,
nodes,
syn_spec={"weight": self.weight, "delay": self.delay, "receptor_type": self.receptor_type},
device,
nodes,
syn_spec={
"weight": self.weight,
"delay": self.delay,
"receptor_type": self.receptor_type,
},
)

except Exception as e:
Expand Down Expand Up @@ -72,4 +76,3 @@ def implement(self, adapter, simulation, simdata):
)
nodes = self.get_target_nodes(adapter, simdata)
self.connect_to_nodes(device, nodes)

15 changes: 12 additions & 3 deletions bsb_nest/devices/sinusoidal_poisson_generator.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
import nest
from bsb import config
from neo import SpikeTrain

from ..device import NestDevice


@config.node
class SinusoidalPoissonGenerator(NestDevice, classmap_entry="sinusoidal_poisson_generator"):
class SinusoidalPoissonGenerator(
NestDevice, classmap_entry="sinusoidal_poisson_generator"
):
rate = config.attr(type=float, required=True)
"""Rate of the poisson generator"""
amplitude = config.attr(type=float, required=True)
Expand All @@ -21,8 +25,13 @@ class SinusoidalPoissonGenerator(NestDevice, classmap_entry="sinusoidal_poisson_

def implement(self, adapter, simulation, simdata):
nodes = self.get_target_nodes(adapter, simulation, simdata)
params = {"rate": self.rate, "start": self.start, "amplitude": self.amplitude, "frequency": self.frequency,
"phase": self.phase}
params = {
"rate": self.rate,
"start": self.start,
"amplitude": self.amplitude,
"frequency": self.frequency,
"phase": self.phase,
}
if self.stop is not None and self.stop > self.start:
params["stop"] = self.stop
device = self.register_device(
Expand Down

0 comments on commit 026c5b3

Please sign in to comment.