Skip to content

Commit

Permalink
Merge pull request #252 from h-mayorquin/fix_annotation_setter
Browse files Browse the repository at this point in the history
Fix probe special properties setter
  • Loading branch information
alejoe91 authored Feb 1, 2024
2 parents 5ae1fde + 6142394 commit 6bb3e93
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/probeinterface/probe.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def name(self):

@name.setter
def name(self, value):
if value is not None:
if value not in [None, ""]:
self.annotate(name=value)

@property
Expand All @@ -134,7 +134,7 @@ def serial_number(self):

@serial_number.setter
def serial_number(self, value):
if value is not None:
if value not in [None, ""]:
self.annotate(serial_number=value)

@property
Expand All @@ -143,7 +143,7 @@ def model_name(self):

@model_name.setter
def model_name(self, value):
if value is not None:
if value not in [None, ""]:
self.annotate(model_name=value)

@property
Expand All @@ -152,7 +152,7 @@ def manufacturer(self):

@manufacturer.setter
def manufacturer(self, value):
if value is not None:
if value not in [None, ""]:
self.annotate(manufacturer=value)

def get_title(self) -> str:
Expand Down
1 change: 1 addition & 0 deletions tests/test_probe.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ def test_probe_equality_dunder():
probe2.move([1, 1])
assert probe2 != probe1


def test_set_shanks():
probe = Probe(ndim=2, si_units="um")
probe.set_contacts(positions=np.arange(20).reshape(10, 2), shapes="circle", shape_params={"radius": 5})
Expand Down

0 comments on commit 6bb3e93

Please sign in to comment.