Repository: ipython/ipython

Issue:
%profile magic is deprecated but still in the documentation
If I try to display my current profile using `%profile`, I get a nice deprecation warning:

```python
In [1]: %profile
UsageError: The `%profile` magic has been deprecated since IPython 2.0. and removed in IPython 6.0. Please use the value of `get_ipython().profile` instead to see current profile in use. Perhaps you meant to use `%prun` to profile code?
```

This is all well and good, except the only reason I tried it is because of the [current docs](http://ipython.readthedocs.io/en/stable/interactive/magics.html#magic-profile). Should I submit a PR removing that line?

Incidentally, I came across this while trying to execute my profile within ptipython. So any suggestions for doing that are welcome!


Discussion:
> This is all well and good, except the only reason I tried it is because of the current docs. Should I submit a PR removing that line?

Ooops, yes please !

> ncidentally, I came across this while trying to execute my profile within ptipython. So any suggestions for doing that are welcome!

I'm unsure I understand this question. You want to find the `~/.ipython/profile_whaever/ipython_config.py` file ?

@Carreau yes, yes I do, because ptipython doesn't seem to load it automatically.
But I would like it to be programmatic, rather than hardcoding the path. 
Try `get_ipython().profile_dir.location` - that works in regular IPython, but I'm not sure where it gets set, so it might not be right in ptipython.
It is indeed set in ptipython (yay!), but `c = get_config()` fails when I try to run it. (boo.) A quick Google search didn't help me understand how to run `get_config` outside of the configuration file loading — or whether it is even remotely advisable.
`get_config()` only makes sense as part of the config file loading - it gets the config object which the rest of the file modifies.

This may be a bit tricky, unfortunately, because our config system is designed to be used with our application framework from traitlets, which I suspect ptipython doesn't use. The config needs to be loaded while the application is starting up, and passed to the IPython objects as they are instantiated.

Unfortunately, I don't have time at the moment to look into the ptipython code to see where it could be integrated.

Resolving patch:
diff --git a/IPython/core/magics/basic.py b/IPython/core/magics/basic.py
--- a/IPython/core/magics/basic.py
+++ b/IPython/core/magics/basic.py
@@ -303,12 +303,14 @@ def page(self, parameter_s=''):
 
     @line_magic
     def profile(self, parameter_s=''):
-        """Print your currently active IPython profile.
+        """DEPRECATED since IPython 2.0.
+
+        Raise `UsageError`. To profile code use the :magic:`prun` magic.
+        
 
         See Also
         --------
-        prun : run code using the Python profiler
-               (:meth:`~IPython.core.magics.execution.ExecutionMagics.prun`)
+        prun : run code using the Python profiler (:magic:`prun`)
         """
         raise UsageError("The `%profile` magic has been deprecated since IPython 2.0. "
             "and removed in IPython 6.0. Please use the value of `get_ipython().profile` instead "


Test patch: