关闭ConfigurationItems

时间:2016-04-07 09:37:10

标签: astropy

我正在进行一些涉及不确定性传播的计算,并且我不断收到大量关于不支持相关不确定性的无用信息日志。我已经知道了,我不在乎,我想停止打印这些消息。

根据文档,它可以“通过         WARN_UNSUPPORTED_CORRELATED配置项“

我无法弄清楚如何做到这一点。如何停止打印这些无用的消息?

1 个答案:

答案 0 :(得分:3)

请参阅http://astropy.readthedocs.org/en/latest/config/index.html

您可以在astropy.cfg

中停用该功能
[nddata]

## Whether to issue a warning if NDData arithmetic is performed with
## uncertainties and the uncertainties do not support the propagation of
## correlated uncertainties.
warn_unsupported_correlated = False

或通过代码:

>>> import astropy.nddata
>>> astropy.nddata.conf.warn_unsupported_correlated = False