コード例 #1
0
class WithNormalEnum(Container):
    class EventType(enum.Enum):
        pedestal = 1
        physics = 2
        calibration = 3

    foo = Field(5, "foo field to test if this still works with more fields")

    event_type = Field(
        EventType.calibration,
        f"type of event, one of: {list(EventType.__members__.keys())}",
    )

    bar = Field(10, "bar field to test if this still works with more fields")
コード例 #2
0
ファイル: test_hdf5.py プロジェクト: Angaraj-Duara/ctapipe
class WithIntEnum(Container):
    class EventType(enum.IntEnum):
        pedestal = 1
        physics = 2
        calibration = 3

    event_type = Field(
        EventType.calibration,
        f'type of event, one of: {list(EventType.__members__.keys())}')
コード例 #3
0
 class C1(Container):
     a = Field("a", None)
     b = Field("b", None)
コード例 #4
0
 class Container1(Container):
     b = Field(1, 'b')
     a = Field(2, 'a')
コード例 #5
0
 class C1(Container):
     a = Field('a', None)
     b = Field('b', None)
コード例 #6
0
 class Container2(Container):
     d = Field(3, "d")
     c = Field(4, "c")
コード例 #7
0
 class TestContainer(Container):
     value = Field(-1, "test")
コード例 #8
0
 class SomeContainer(Container):
     container_prefix = ""
     hillas_x = Field(1)
     hillas_y = Field(1)
コード例 #9
0
 class SomeContainer(Container):
     container_prefix = ""
     hillas_x = Field(None)
     hillas_y = Field(None)
     impact_x = Field(None)
     impact_y = Field(None)
コード例 #10
0
ファイル: test_hdf5.py プロジェクト: ssteinmassl/ctapipe
 class SomeContainer(Container):
     value = Field(-1, "some value that should be transformed")
コード例 #11
0
 class Container2(Container):
     container_prefix = ""
     string = Field("", "test string", max_length=10)
コード例 #12
0
 class Container1(Container):
     container_prefix = ""
     string = Field("", "test string")
コード例 #13
0
 class WithUnits(Container):
     inverse_length = Field(5 / u.m, 'foo')
     time = Field(1 * u.s, 'bar', unit=u.s)
     grammage = Field(2 * u.g / u.cm**2, 'baz', unit=u.g / u.cm**2)
コード例 #14
0
 class Container2(Container):
     d = Field(3, 'd')
     c = Field(4, 'c')
コード例 #15
0
    class ContainerA(Container):

        a = Field(0, "some integer field")
コード例 #16
0
 class SomeContainer(Container):
     container_prefix = ""
     image = Field(np.array([np.nan, np.inf, -np.inf]))
コード例 #17
0
 class WithUnits(Container):
     inverse_length = Field(5 / u.m, "foo")
     time = Field(1 * u.s, "bar", unit=u.s)
     grammage = Field(2 * u.g / u.cm**2, "baz", unit=u.g / u.cm**2)
コード例 #18
0
    class SomeContainer(Container):
        container_prefix = ""

        current = Field(1 * u.A, unit=u.uA)
        time = Field(NAN_TIME)
        image = Field(np.array([1.234, 123.456]))
コード例 #19
0
 class C1(Container):
     a = Field(None, "a")
     b = Field(None, "b")
コード例 #20
0
 class TimeContainer(Container):
     time = Field(None, "an astropy time")
コード例 #21
0
 class C2(Container):
     c = Field(None, "c")
     d = Field(None, "d")
コード例 #22
0
 class Container1(Container):
     b = Field(1, "b")
     a = Field(2, "a")
コード例 #23
0
 class C(Container):
     boolean = Field(True, "Boolean value")
コード例 #24
0
    class ContainerA(Container):

        a = Field(int)
コード例 #25
0
 class C(Container):
     value = Field(True, "Integer value")
コード例 #26
0
 class C2(Container):
     c = Field('c', None)
     d = Field('d', None)
コード例 #27
0
 class TestContainer(Container):
     value = Field(-1, 'test')