ScienceState#
- class astropy.utils.state.ScienceState[源代码]#
基类:
object
科学状态子类用于管理可能影响科学结果的全局项。子类通常会重写
validate
to convert from any of the acceptable inputs (such as strings) to the appropriate internal objects, and set an initial value to the ``_ 值``成员,因此它具有默认值。实例
class MyState(ScienceState): @classmethod def validate(cls, value): if value not in ('A', 'B', 'C'): raise ValueError("Must be one of A, B, C") return value
方法总结
方法文件