ScienceState¶
-
class
astropy.utils.state.
ScienceState
[source] [edit on github]¶ Bases:
object
Science state subclasses are used to manage global items that can affect science results. Subclasses will generally override
validate
to convert from any of the acceptable inputs (such as strings) to the appropriate internal objects, and set an initial value to the_value
member so it has a default.Examples
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
Methods Summary
get
()Get the current science state value. set
(value)Set the current science state value. validate
(value)Validate the value and convert it to its native type, if necessary. Methods Documentation
-
classmethod
get
()[source] [edit on github]¶ Get the current science state value.
-
classmethod
set
(value)[source] [edit on github]¶ Set the current science state value.
-
classmethod
validate
(value)[source] [edit on github]¶ Validate the value and convert it to its native type, if necessary.
-
classmethod