Skip to content

Commit

Permalink
Merge branch 'docstrings' of https://github.com/zm711/probeinterface
Browse files Browse the repository at this point in the history
…into docstrings
  • Loading branch information
zm711 committed Nov 29, 2023
2 parents 38971d8 + f6ea9f1 commit d41c06e
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/probeinterface/probegroup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ def __init__(self):
self.probes = []

def add_probe(self, probe: Probe):
"""
"""
Add an additional probe to the ProbeGroup
Parameters
----------
probe: Probe
The probe to add to the ProbeGroup
"""
if len(self.probes) > 0:
self._check_compatible(probe)
Expand All @@ -38,8 +38,9 @@ def _check_compatible(self, probe: Probe):
)

if probe.ndim != self.probes[-1].ndim:
raise ValueError(f"ndim are not compatible: probe.ndim {probe.ndim} "
f"!= probegroup ndim {self.probes[-1].ndim}")
raise ValueError(
f"ndim are not compatible: probe.ndim {probe.ndim} " f"!= probegroup ndim {self.probes[-1].ndim}"
)

# check global channel maps
self.probes.append(probe)
Expand Down Expand Up @@ -168,7 +169,7 @@ def to_dict(self, array_as_list: bool = False):
return d

@staticmethod
def from_dict(d:dict):
def from_dict(d: dict):
"""Instantiate a ProbeGroup from a dictionary
Parameters
Expand All @@ -191,7 +192,7 @@ def get_global_device_channel_indices(self) -> np.ndarray:
"""
Gets the global device channels indices and returns as
an array
Returns
-------
channels: np.ndarray
Expand Down Expand Up @@ -221,7 +222,9 @@ def set_global_device_channel_indices(self, channels: np.array | list):
"""
channels = np.asarray(channels)
if channels.size != self.get_contact_count():
raise ValueError(f"Wrong channels size {channels.size} for the number of channels {self.get_contact_count()}")
raise ValueError(
f"Wrong channels size {channels.size} for the number of channels {self.get_contact_count()}"
)

# first reset previsous indices
for i, probe in enumerate(self.probes):
Expand Down

0 comments on commit d41c06e

Please sign in to comment.