diff --git a/src/probeinterface/probe.py b/src/probeinterface/probe.py index 3d523d5..c935581 100644 --- a/src/probeinterface/probe.py +++ b/src/probeinterface/probe.py @@ -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 @@ -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 @@ -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 @@ -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: diff --git a/tests/test_probe.py b/tests/test_probe.py index 8ec2ddf..58066ef 100644 --- a/tests/test_probe.py +++ b/tests/test_probe.py @@ -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})