def _calc_gradient(self, inputs, outputs, mode='auto',
                       return_format='array', options=None, force_regen=False):

        # if inputs aren't specified, use parameters
        if inputs is None:
            if hasattr(self, 'list_param_group_targets'):
                inputs = self.list_param_group_targets()
            if not inputs:
                msg = "No inputs given for derivatives."
                self.raise_exception(msg, RuntimeError)

        # If outputs aren't specified, use the objectives and constraints
        if outputs is None:
            outputs = []
            if hasattr(self, 'list_objective_targets'):
                outputs.extend(self.list_objective_targets())
            if hasattr(self, 'list_constraint_targets'):
                outputs.extend(self.list_constraint_targets())
            if not outputs:
                msg = "No outputs given for derivatives."
                self.raise_exception(msg, RuntimeError)

        inputs  = [_fix_tups(x) for x in inputs]
        outputs = [_fix_tups(x) for x in outputs]

        self.workflow._calc_gradient_inputs = inputs[:]
        self.workflow._calc_gradient_outputs = outputs[:]

        try:
            if force_regen:
                top = self
                while top.parent is not None:
                    top = top.parent

                top._setup(inputs=inputs, outputs=outputs, drvname=self.name)

            if options is None:
                options = self.gradient_options

            J = self.workflow.calc_gradient(inputs, outputs, mode, return_format,
                                            options=options)

            # Finally, we need to untransform the jacobian if any parameters have
            # scalers.
            if not hasattr(self, 'get_parameters'):
                return J

            params = self.get_parameters()

            if len(params) == 0:
                return J

            i = 0
            for group in inputs:

                if isinstance(group, str):
                    pname = name = group
                else:
                    pname = tuple(group)
                    name = group[0]

                # Note: 'dict' is the only valid return_format for MPI runs.
                if return_format == 'dict':
                    if pname in params:
                        scaler = params[pname].scaler
                        if scaler != 1.0:
                            for okey in J.keys():
                                J[okey][name] = J[okey][name]*scaler

                else:
                    width = len(self._system.vec['u'][name])

                    if pname in params:
                        scaler = params[pname].scaler
                        if scaler != 1.0:
                            J[:, i:i+width] = J[:, i:i+width]*scaler

                    i += width

        finally:
            self.workflow._calc_gradient_inputs = None
            self.workflow._calc_gradient_outputs = None

        return J
dir property returns nothing for any other field.
dataset/ETHPy150Open OpenMDAO/OpenMDAO-Framework/openmdao.main/src/openmdao/main/driver.py/Driver._calc_gradient--crossover with--dataset/ETHPy150Open mozilla/moztrap/tests/view/lists/test_sort.py/SortTest.test_dir_other_field