def setup(self, parent_params_vec, params_dict, srcvec, my_params,
              connections, relevance=None, var_of_interest=None,
              store_byobjs=False, shared_vec=None, alloc_complex=False):
        """
        Configure this vector to store a flattened array of the variables
        in params_dict. Variable shape and value are retrieved from srcvec.

        Args
        ----
        parent_params_vec : `VecWrapper` or None
            `VecWrapper` of parameters from the parent `System`.

        params_dict : `OrderedDict`
            Dictionary of parameter absolute name mapped to metadata dict.

        srcvec : `VecWrapper`
            Source `VecWrapper` corresponding to the target `VecWrapper` we're building.

        my_params : list of str
            A list of absolute names of parameters that the `VecWrapper` we're building
            will 'own'.

        connections : dict of str : str
            A dict of absolute target names mapped to the absolute name of their
            source variable.

        relevance : `Relevance` object
            Object that knows what vars are relevant for each var_of_interest.

        var_of_interest : str or None
            Name of the current variable of interest.

        store_byobjs : bool, optional
            If True, store 'pass by object' variables in the `VecWrapper` we're building.

        shared_vec : ndarray, optional
            If not None, create vec as a subslice of this array.

        alloc_complex : bool, optional
            If True, allocate space for the imaginary part of the vector and
            configure all functions to support complex computation.
        """
        # dparams vector has some additional behavior
        if not store_byobjs:
            self.deriv_units = True

        src_to_prom_name = srcvec._sysdata.to_prom_name
        scoped_name = self._sysdata._scoped_abs_name
        vec_size = 0
        missing = []  # names of our params that we don't 'own'
        syspath = self._sysdata.pathname + '.'

        for meta in itervalues(params_dict):
            if relevance is None or relevance.is_relevant(var_of_interest,
                                                          meta['top_promoted_name']):
                pathname = meta['pathname']
                if pathname in my_params:
                    # if connected, get metadata from the source
                    try:
                        src = connections[pathname]
                    except __HOLE__:
                        raise RuntimeError("Parameter '%s' is not connected" % pathname)
                    src_pathname, idxs = src
                    src_rel_name = src_to_prom_name[src_pathname]
                    src_acc = srcvec._dat[src_rel_name]

                    slc, val = self._setup_var_meta(pathname, meta, vec_size,
                                                    src_acc, store_byobjs)

                    if 'remote' not in meta or not meta['remote']:
                        vec_size += meta['size']

                    self._dat[scoped_name(pathname)] = Accessor(self, slc, val,
                                                                meta,
                                                                self._probdata,
                                                                alloc_complex)

                elif parent_params_vec is not None and pathname in connections:
                    src, _ = connections[pathname]
                    common = get_common_ancestor(src, pathname)
                    if (common == self._sysdata.pathname or
                                                syspath not in common):
                        missing.append(pathname)

        if shared_vec is not None:
            self.vec = shared_vec[:vec_size]
        else:
            self.alloc_complex = alloc_complex
            self.vec = numpy.zeros(vec_size)
            if alloc_complex:
                self.imag_vec = numpy.zeros(vec_size)

        # map slices to the array
        for acc in itervalues(self._dat):
            if not (acc.pbo or acc.remote):
                start, end = acc.slice
                acc.val = self.vec[start:end]
                if alloc_complex:
                    acc.imag_val = self.imag_vec[start:end]

        # fill entries for missing params with views from the parent
        if parent_params_vec is not None:
            parent_scoped_name = parent_params_vec._sysdata._scoped_abs_name

        for pathname in missing:
            parent_acc = parent_params_vec._dat[parent_scoped_name(pathname)]
            newmeta = parent_acc.meta
            if newmeta['pathname'] == pathname:

                if alloc_complex is True and not newmeta.get('pass_by_obj'):
                    imag_val = parent_acc.imag_val
                else:
                    imag_val = None

                # mark this param as not 'owned' by this VW
                self._dat[scoped_name(pathname)] = Accessor(self, None,
                                                            parent_acc.val,
                                                            newmeta, self._probdata,
                                                            alloc_complex,
                                                            owned=False,
                                                            imag_val=imag_val)
dataset/ETHPy150Open OpenMDAO/OpenMDAO/openmdao/core/vec_wrapper.py/TgtVecWrapper.setup