[AstroPy] DeprecationWarning from ipython [metadata was set from the constructor]

Duncan Macleod duncan.macleod at ligo.org
Wed Apr 13 19:55:53 EDT 2016


Hi all,

With macports installs of python/ipython/astropy, for a while now I've been
getting a DeprecationWarning when import astropy, related to something in
ipython. Here is the traceback when I escalate it to an error:

$ python -c "import warnings; warnings.simplefilter('error',
DeprecationWarning); import astropy"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File
"/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/astropy/__init__.py",
line 284, in <module>
    from .logger import _init_log, _teardown_log
  File
"/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/astropy/logger.py",
line 17, in <module>
    from .utils.console import color_print
  File
"/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/astropy/utils/console.py",
line 29, in <module>
    from IPython import get_ipython
  File
"/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/IPython/__init__.py",
line 48, in <module>
    from .core.application import Application
  File
"/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/IPython/core/application.py",
line 25, in <module>
    from IPython.core.profiledir import ProfileDir, ProfileDirError
  File
"/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/IPython/core/profiledir.py",
line 29, in <module>
    class ProfileDir(LoggingConfigurable):
  File
"/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/IPython/core/profiledir.py",
line 52, in ProfileDir
    `profile` option.""",
  File
"/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/traitlets/traitlets.py",
line 421, in __init__
    DeprecationWarning, stacklevel=stacklevel)
DeprecationWarning: metadata {'config': True} was set from the
constructor.  Metadata should be set using the .tag() method, e.g.,
Int().tag(key1='value1', key2='value2')

Can anyone offer a reason why this is, whether it has been reported before,
or whether I can disable the astropy logger in some way (I just want
astropy.units!)?

For the record, I have the following versions:

$ port installed | egrep " python27 | py27-ipython | py27-astropy " | grep
"(active)"
  py27-astropy @1.1.1_2 (active)
  py27-ipython @4.1.2_0 (active)
  python27 @2.7.11_2 (active)


Thanks in advance
Duncan
-- 
Duncan Macleod
duncan.macleod at ligo.org
LIGO Data Grid systems development
Louisiana State University
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/astropy/attachments/20160413/7d2e2ea0/attachment.html>


More information about the AstroPy mailing list