Commit 6adf7afd authored by Anton Akhmerov's avatar Anton Akhmerov
Browse files

extra check for attaching leads

parent b6cb7dd4
......@@ -1070,6 +1070,9 @@ class Builder(object):
The lead numbering starts from zero and increments from there, i.e.
the leads are numbered in the order in which they are attached.
"""
if self.symmetry.num_directions:
raise ValueError("Can only attach leads to finite systems")
if add_cells < 0 or int(add_cells) != add_cells:
raise ValueError('add_cells must be an integer >= 0.')
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment