class_docstr: Base class of a proximal operator with groups. It applies specific
  proximal operator in each group, or block. Blocks (non-overlapping) are
  specified by the ``blocks_start`` and ``blocks_length`` parameters.
  This base class is not intented for end-users, but for developers only.
  
  Parameters
  ----------
  strength : `float`
      Level of penalization
  
  blocks_start : `list` or `numpy.array`, shape=(n_blocks,)
      First entry of each block
  
  blocks_length : `list` or `numpy.array`, shape=(n_blocks,)
      Size of each block
  
  range : `tuple` of two `int`, default=`None`
      Range on which the prox is applied. If `None` then the prox is
      applied on the whole vector
  
  positive : `bool`, default=`False`
      If True, apply the penalization together with a projection
      onto the set of vectors with non-negative entries
  
  Attributes
  ----------
  n_blocks : `int`
      Number of blocks
class_docstr_tok: ["Base","class","of","a","proximal","operator","with","groups",".","It","applies","specific","proximal","operator","in","each","group",",","or","block",".","Blocks","(","non-overlapping",")","are","specified","by","the","``","blocks_start","``","and","``","blocks_length","``","parameters",".","This","base","class","is","not","intented","for","end-users",",","but","for","developers","only",".","Parameters","--","--","--","--","--","strength",":","`","float","`","Level","of","penalization","blocks_start",":","`","list","`","or","`","numpy.array","`",",","shape=","(","n_blocks",",",")","First","entry","of","each","block","blocks_length",":","`","list","`","or","`","numpy.array","`",",","shape=","(","n_blocks",",",")","Size","of","each","block","range",":","`","tuple","`","of","two","`","int","`",",","default=","`","None","`","Range","on","which","the","prox","is","applied",".","If","`","None","`","then","the","prox","is","applied","on","the","whole","vector","positive",":","`","bool","`",",","default=","`","False","`","If","True",",","apply","the","penalization","together","with","a","projection","onto","the","set","of","vectors","with","non-negative","entries","Attributes","--","--","--","--","--","n_blocks",":","`","int","`","Number","of","blocks"]
code: def __init__(
      self,
      strength: float,
      blocks_start,
      blocks_length,
      range: tuple = None,
      positive: bool = False,
  ):
      Prox.__init__(self, range)
  
      if any(length <= 0 for length in blocks_length):
          raise ValueError("all blocks must be of positive size")
      if any(start < 0 for start in blocks_start):
          raise ValueError(
              "all blocks must have positive starting indices"
          )
  
      if type(blocks_start) is list:
          blocks_start = np.array(blocks_start, dtype=np.uint64)
      if type(blocks_length) is list:
          blocks_length = np.array(blocks_length, dtype=np.uint64)
  
      if blocks_start.dtype is not np.uint64:
          blocks_start = blocks_start.astype(np.uint64)
      if blocks_length.dtype is not np.uint64:
          blocks_length = blocks_length.astype(np.uint64)
  
      if blocks_start.shape != blocks_length.shape:
          raise ValueError(
              "``blocks_start`` and ``blocks_length`` "
              "must have the same size"
          )
      if np.any(blocks_start[1:] < blocks_start[:-1]):
          raise ValueError("``block_start`` must be sorted")
      if np.any(
          blocks_start[1:] < blocks_start[:-1] + blocks_length[:-1]
      ):
          raise ValueError("blocks must not overlap")
  
      self.strength = strength
      self.positive = positive
      self.blocks_start = blocks_start
      self.blocks_length = blocks_length
  
      # Get the C++ prox class, given by an overloaded method
      self._prox = self._build_cpp_prox("float64")
  
file_path: tick/tick/prox/base/prox_with_groups.py
imports: import numpy
  from .None import Prox
label_desc: Use image node_id 1 to create a new ProxWithGroups object from inherited base classes: Prox with example: obj = ProxWithGroups(strength, blocks_start, blocks_length, range, positive)