Skip to content

Commit

Permalink
minor updates
Browse files Browse the repository at this point in the history
  • Loading branch information
demisjohn committed Aug 17, 2016
1 parent ea21b87 commit 1a99484
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions pyfimm/__Device.py
Original file line number Diff line number Diff line change
Expand Up @@ -1223,7 +1223,7 @@ def plot(self, component, zpoints=3000, zmin=0.0, zmax=None, xcut=0.0, ycut=0.0,
#### ####
################################################################

def buildNode(self, name=None, parent=None, overwrite=False, warn=False):

'''Build the Fimmwave node of this Device.
Parameters
Expand All @@ -1242,7 +1242,7 @@ def buildNode(self, name=None, parent=None, overwrite=False, warn=False):
To Do:
------
Add optional argument `buildNode = True`, which will build all passed WG objects while adding them to the Device.
Add optional argument `build_elements = True`, which will build all passed WG objects while adding them to the Device.
'''
if self.built: raise UserWarning( 'Device "%s".buildNode(): Device is already built in FimmWave! Aborting.'%(self.name) )
Expand Down Expand Up @@ -1307,7 +1307,7 @@ def buildNode(self, name=None, parent=None, overwrite=False, warn=False):
fpString += self.nodestring + ".cdev.eltlist["+str(elnum)+"].length="+str(self.lengths[ii]) + " \n"

elif isinstance( el, Lens ):
'''The Lens object will be a Waveguide Lens type of element.'''
'''The Lens object will be a Waveguide Lens element.'''
if DEBUG(): print "Device.buildNode(): type = Lens"
fpString += self.__BuildLensElement( el, elnum )
el.built = True
Expand All @@ -1322,7 +1322,11 @@ def buildNode(self, name=None, parent=None, overwrite=False, warn=False):
print self.name + ".buildNode(): Attempting to build the unbuilt element:", el.name
el.buildNode() # tell the element to build itself
except:
errstr = "Error while building Device Node `"+self.name+"`: \nA constituent waveguide could not be built. Perhaps try building all waveguide nodes via `WGobj.buildNode()` before building the Device."
try:
elname = el.name
except AttributeError:
elname=el.__repr__()
errstr = "Error while building Device Node `"+self.name+"`: \nA constituent element `" +elname+ "` could not be built. Perhaps try building all waveguide nodes via `WGobj.buildNode()` before building the Device."
raise RuntimeError(errstr)

if DEBUG(): print "Device.buildNode(): %i: type(el)=%s, name=%s"%(ii, str(type(el)), el.name)
Expand Down

1 comment on commit 1a99484

@demisjohn
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops, accidentally deleted Device.buildNode()!!

Please sign in to comment.