Commit b221f12d authored by Martin Reinecke's avatar Martin Reinecke
Browse files

better argument name

parent f07a6090
......@@ -76,16 +76,16 @@ def safe_cast(tfunc, val):
return tmp
def parse_spaces(spaces, maxidx):
maxidx = safe_cast(int, maxidx)
def parse_spaces(spaces, nspc):
nspc = safe_cast(int, nspc)
if spaces is None:
return tuple(range(maxidx))
return tuple(range(nspc))
elif np.isscalar(spaces):
spaces = (safe_cast(int, spaces),)
spaces = tuple(safe_cast(int, item) for item in spaces)
tmp = tuple(set(spaces))
if tmp[0] < 0 or tmp[-1] >= maxidx:
if tmp[0] < 0 or tmp[-1] >= nspc:
raise ValueError("space index out of range")
if len(tmp) != len(spaces):
raise ValueError("multiply defined space indices")
Markdown is supported
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