Skip to content

Commit

Permalink
Make constructor annotations optional
Browse files Browse the repository at this point in the history
  • Loading branch information
alejoe91 committed Aug 29, 2023
1 parent 886e7b1 commit f56a9d7
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/probeinterface/probe.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,15 @@ def __init__(self, ndim=2, si_units="um", name=None, serial_number=None, model_n
# annotation: a dict that contains all meta information about
# the probe (name, manufacturor, date of production, ...)
self.annotations = dict()
self.annotate(
name=name if name is not None else "",
serial_number=serial_number if serial_number is not None else "",
model_name=model_name if model_name is not None else "",
manufacturer=manufacturer if manufacturer is not None else "",
)
if name is not None:
self.annotate(name=name)
if serial_number is not None:
self.annotate(serial_number=serial_number)
if model_name is not None:
self.annotate(model_name=model_name)
if manufacturer is not None:
self.annotate(manufacturer=manufacturer)

# same idea but handle in vector way for contacts
self.contact_annotations = dict()

Expand Down

0 comments on commit f56a9d7

Please sign in to comment.