形态#
- class astropy.time.Conf[源代码]#
-
的配置参数
astropy.time
。属性摘要
用于屏蔽输出数据的屏蔽数组的类型。
对支持的时间字符串格式使用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)#
打印有关配置项的信息。
- 参数:
- name :
str
,可选可选的STR 要描述的配置项的名称。如果未提供名称,则将打印有关所有配置项的信息。
- name :
实例
>>> 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()#
- set_temp(attr, value)#
临时设置一个配置值。
实例
>>> import astropy >>> with astropy.conf.set_temp('use_color', False): ... pass ... # console output will not contain color >>> # console output contains color again...
- values()#
迭代配置项值。