ScienceState¶
- class astropy.utils.state.ScienceState[ソース]¶
- ベースクラス: - object- 科学状態サブクラスは,科学結果に影響を与える可能性のあるグローバルプロジェクトを管理するために用いられる.サブクラスは通常書き換えられます - validateto convert from any of the acceptable inputs (such as strings) to the appropriate internal objects, and set an initial value to the ``_ Value≡`メンバであるため,デフォルト値を持つ.- 実例. - 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 - 方法要約 - get\()- 現在の科学状態値を取得します - set\(値)- 現在の科学状態値を設定する。 - validate\(値)- 必要であれば,値を検証してネイティブタイプに変換する. - 方法文書