argiope/mesh.py
def set_nodes(self, nlabels = [], coords = [], nsets = {}, **kwargs):
    r"""
    Sets the node data.
    
    :arg nlabels: node labels. Items be strictly positive and int typed 
                  in 1D array-like with shape :math:`(N_n)`.
    :type nlabels: 1D uint typed array-like
    :arg coords: node coordinates. Must be float typed 2D array-like of shape 
                 :math:`(N_n \times 3)`.  
    :type coords: 2D float typed array-like            
    :arg nsets: node sets. Contains boolean array-like of shape :math:`(N_n)`.
    :type nsets: dict
    """ 
    # DATA PREPROCESSING
    nlabels = np.array(nlabels).astype(np.int64)
    coords = np.array(coords).astype(np.float64)
    if (nlabels < 0).sum() > 0: 
      raise ValueError("Node labels must be strictly positive.")
    if len(nlabels) != len(coords):
      raise ValueError("'nlabels' and 'coords' must have the same length")
    if coords.shape[1] != 3:
      raise ValueError("coordinates must be 3 dimensional.")    
    # ATTRIBUTES CREATION
    columns = pd.MultiIndex.from_tuples((("coords", "x"), 
                                         ("coords", "y"), 
                                         ("coords", "z")))
    self.nodes = pd.DataFrame(data = coords, 
                              columns = columns,
                              index = nlabels)
    self.nodes.index.name = "node"
    for k, v in nsets.items(): 
      v = np.array(v)
      if v.dtype != 'bool':
        raise ValueError("Sets must be boolean array-likes.")   
      self.nodes["sets", k] = v
    self.nodes["sets", "all"] = True
def set_nodes(self, nlabels = [], coords = [], nsets = {}, **kwargs):
    r"""
    Sets the node data.
    
    :arg nlabels: node labels. Items be strictly positive and int typed 
                  in 1D array-like with shape :math:`(N_n)`.
    :type nlabels: 1D uint typed array-like
    :arg coords: node coordinates. Must be float typed 2D array-like of shape 
                 :math:`(N_n \times 3)`.  
    :type coords: 2D float typed array-like            
    :arg nsets: node sets. Contains boolean array-like of shape :math:`(N_n)`.
    :type nsets: dict
    """ 
    # DATA PREPROCESSING
    nlabels = np.array(nlabels).astype(np.int64)
    coords = np.array(coords).astype(np.float64)
    if (nlabels < 0).sum() > 0: 
      raise ValueError("Node labels must be strictly positive.")
    if len(nlabels) != len(coords):
      raise ValueError("'nlabels' and 'coords' must have the same length")
    if coords.shape[1] != 3:
      raise ValueError("coordinates must be 3 dimensional.")    
    # ATTRIBUTES CREATION
    columns = pd.MultiIndex.from_tuples((("coords", "x"), 
                                         ("coords", "y"), 
                                         ("coords", "z")))
    self.nodes = pd.DataFrame(data = coords, 
                              columns = columns,
                              index = nlabels)
    self.nodes.index.name = "node"
    for k, v in nsets.items(): 
      v = np.array(v)
      if v.dtype != 'bool':
        raise ValueError("Sets must be boolean array-likes.")   
      self.nodes["sets", k] = v
    self.nodes["sets", "all"] = True
r"""
    Sets the node data.
    
    :arg nlabels: node labels. Items be strictly positive and int typed 
                  in 1D array-like with shape :math:`(N_n)`.
    :type nlabels: 1D uint typed array-like
    :arg coords: node coordinates. Must be float typed 2D array-like of shape 
                 :math:`(N_n \times 3)`.  
    :type coords: 2D float typed array-like            
    :arg nsets: node sets. Contains boolean array-like of shape :math:`(N_n)`.
    :type nsets: dict