形态#

class astropy.time.Conf[源代码]#

基类:ConfigNamespace

的配置参数 astropy.time

属性摘要

masked_array_type 

用于屏蔽输出数据的屏蔽数组的类型。

use_fast_parser 

对支持的时间字符串格式使用fastcparser,包括ISO、ISOT和YearDayTime。

方法总结

help([name])

打印有关配置项的信息。

items \()

迭代配置项 (name, value) 对。

keys \()

reload([attr])

从配置文件重新加载配置项。

reset([attr])

将配置项重置为其默认值。

set_temp(attr, value)

临时设置一个配置值。

values \()

迭代配置项值。

属性文档

masked_array_type#

用于屏蔽输出数据的屏蔽数组的类型。可以是“占星级”的 astropy.utils.masked.Masked 或者“麻木”来使用 numpy.ma.MaskedArray 。请注意,如果 astropy.units.Quantity ,则输出始终使用 astropy.utils.masked.Masked ,因为 numpy.ma.MaskedArray 不适用于数量。

use_fast_parser#

对支持的时间字符串格式使用fastcparser,包括ISO、ISOT和YearDayTime。允许的值是'False'(使用Python解析器)、'True'(如果失败,使用C parser和fall through to Python parser)和'force'(如果失败,使用C解析器并引发异常)。注意选项都是字符串。

方法文件

help(name=None)#

打印有关配置项的信息。

参数:
namestr ,可选可选的STR

要描述的配置项的名称。如果未提供名称,则将打印有关所有配置项的信息。

实例

>>> from astropy import conf
>>> conf.help("unicode_output")
ConfigItem: unicode_output
  cfgtype='boolean'
  defaultvalue=False
  description='When True, use Unicode characters when outputting values, and displaying widgets at the console.'
  module=astropy
  value=False
items()#

迭代配置项 (name, value) 对。

keys()#
reload(attr=None)#

从配置文件重新加载配置项。

参数:
attr : str ,可选Python:字符串,可选

要重新加载的配置参数的名称。如果未提供,请重新加载所有配置参数。

reset(attr=None)#

将配置项重置为其默认值。

参数:
attr : str ,可选Python:字符串,可选

要重新加载的配置参数的名称。如果未提供,请重置所有配置参数。

set_temp(attr, value)#

临时设置一个配置值。

参数:
attr : strPython :字符串

配置项名称

value : object对象

要临时设置的值。

实例

>>> import astropy
>>> with astropy.conf.set_temp('use_color', False):
...     pass
...     # console output will not contain color
>>> # console output contains color again...
values()#

迭代配置项值。