@property<EOL><INDENT>def shadow_price(self):<DEDENT>
try:<EOL><INDENT>check_solver_status(self._model.solver.status)<EOL>return self._model.constraints[self.id].dual<EOL><DEDENT>except AttributeError:<EOL><INDENT>raise RuntimeError(<EOL>"<STR_LIT>".format(self.id))<EOL><DEDENT>except (RuntimeError, OptimizationError) as err:<EOL><INDENT>raise_with_traceback(err)<EOL><DEDENT>except Exception as err:<EOL><INDENT>raise_from(OptimizationError(<EOL>"<STR_LIT>"<EOL>"<STR_LIT>".format(str(err))), err)<EOL><DEDENT>
The shadow price in the most recent solution.

Shadow price is the dual value of the corresponding constraint in the
model.

Warnings
--------
* Accessing shadow prices through a `Solution` object is the safer,
  preferred, and only guaranteed to be correct way. You can see how to
  do so easily in the examples.
* Shadow price is retrieved from the currently defined
  `self._model.solver`. The solver status is checked but there are no
  guarantees that the current solver state is the one you are looking
  for.
* If you modify the underlying model after an optimization, you will
  retrieve the old optimization values.

Raises
------
RuntimeError
    If the underlying model was never optimized beforehand or the
    metabolite is not part of a model.
OptimizationError
    If the solver status is anything other than 'optimal'.

Examples
--------
>>> import cobra
>>> import cobra.test
>>> model = cobra.test.create_test_model("textbook")
>>> solution = model.optimize()
>>> model.metabolites.glc__D_e.shadow_price
-0.09166474637510488
>>> solution.shadow_prices.glc__D_e
-0.091664746375104883