コード例 #1
0
    def _list_states(self):
        """
        Return list of all states at and below this system.

        Returns
        -------
        list
            List of all states.
        """
        return [rel_name2abs_name(self, name) for name in self._state_names]
コード例 #2
0
ファイル: vector.py プロジェクト: araujolma/OpenMDAO
    def name2abs_name(self, name):
        """
        Map the given promoted or relative name to the absolute name.

        This is only valid when the name is unique; otherwise, a KeyError is thrown.

        Parameters
        ----------
        name : str
            Promoted or relative variable name in the owning system's namespace.

        Returns
        -------
        str or None
            Absolute variable name if unique abs_name found or None otherwise.
        """
        system = self._system()
        abs_name = prom_name2abs_name(system, name, self._typ)
        if abs_name in self._names:
            return abs_name

        abs_name = rel_name2abs_name(system, name)
        if abs_name in self._names:
            return abs_name