original_docstring: 
      put saved element data to hardware
      
docstring: put saved element data to hardware
docstring_tokens: put saved element data to hardware
code: def putElement(elem, output, h5group = "/", force = False):
      """
      put saved element data to hardware
      """
      import h5py
      h5f = h5py.File(output, 'r')
      grp = h5f[h5group]
  
      if elem.name != grp.attrs["name"]:
          _logger.warn("not same element name: %s != %s" % (
                  elem.name, grp.attrs["name"]))
          if not force:
              h5f.close()
              return
  
      for fld in elem.fields():
          dsname = fld + '.sp'
          if dsname not in grp.keys():
              _logger.warn("%s not found in %s/%s" % (dsname, output, h5group))
              continue
          val = grp[dsname].value
          elem.put(fld, val, unitsys=None)
      h5f.close()
code_tokens: def putElement ( elem , output , h5group = "/" , force = False ) : import h5py h5f = h5py . File ( output , 'r' ) grp = h5f [ h5group ] if elem . name != grp . attrs [ "name" ] : _logger . warn ( "not same element name: %s != %s" % ( elem . name , grp . attrs [ "name" ] ) ) if not force : h5f . close ( ) return for fld in elem . fields ( ) : dsname = fld + '.sp' if dsname not in grp . keys ( ) : _logger . warn ( "%s not found in %s/%s" % ( dsname , output , h5group ) ) continue val = grp [ dsname ] . value elem . put ( fld , val , unitsys = None ) h5f . close ( )
short_docstring: put saved element data to hardware
short_docstring_tokens: put saved element data to hardware
comment: """
      put saved element data to hardware
      """