Commit d47fd098 authored by Joseph Weston's avatar Joseph Weston

builder.fill: raise warning when starting with a site not in template

We raise a warning and remove the sites from 'start', so as to avoid
cryptic 'KeyError's later.

Also take an early exit if there are no starting sites in the template,
to avoid a spurious warning about all starting sites already being
present in the target.

Closes #224.
parent 036056ae
......@@ -1346,6 +1346,14 @@ class Builder:
if start and not isinstance(start[0], Site):
start = [template.closest(start)]
if any(s not in template for s in start):
warnings.warn("fill(): Some of the starting sites are "
"not in the template builder.",
RuntimeWarning, stacklevel=2)
start = [s for s in start if s in template]
if not start:
return []
try:
# "Active" are sites (mapped to the target's FD) that have been
# verified to lie inside the shape, have been added to the target
......
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