示例#1
0
    def test_disable(self):
        x = ui.Text(
            name='DevName',
            description="Device name.",
            value='Destiny001',
            width='50%'
        )

        assert x.disabled is False
        x.disabled = True
        assert x.disabled is True
        x.disabled = False
        assert x.disabled is False
示例#2
0
    def test_basic(self):
        x = ui.Text(
            name='DevName',
            description="Device name.",
            value='Destiny001',
            width='50%'
        )

        assert x.value == 'Destiny001'

        x.value = 'Destiny002'
        assert x.value == 'Destiny002'

        with pytest.raises(ValueError):
            x.value = None
示例#3
0
    def test_callback(self):
        x = ui.Text(
            name='DevName',
            description="Device name.",
            value='Destiny001',
            cb=self.cb
        )

        x.value = 'Destiny002'
        assert x.value == 'Destiny002'
        assert TestText.cval == 'Destiny002'
        assert TestText.callbacks['DevName'] == 1

        x.value = 'DestinyXXX'
        assert x.value == 'DestinyXXX'
        assert TestText.cval == 'DestinyXXX'
        assert TestText.callbacks['DevName'] == 2
    PARADIM_UI['s0']['button'],
    PARADIM_UI['s0']['status'],
],
                                      name='MARCC Credentials')
''',PARADIM_UI['s0']['commands']'''

##################################################
# First
##################################################

PARADIM_UI['s1'] = {}
PARADIM_UI['s1']['ecutwfc'] = ui.String(name='ecutwfc',
                                        description='ecutwfc',
                                        value='40.0')
PARADIM_UI['s1']['kpoints'] = ui.Text(description="kpoints",
                                      name="kpoints",
                                      value='''automatic
6 6 6 1 1 1''')
PARADIM_UI['s1']['kpoints'].dd.layout = Layout(height='120px')
PARADIM_UI['s1']['input'] = ui.Text(description="inputdeck",
                                    name="inputdeck",
                                    value='''''')
PARADIM_UI['s1']['input'].dd.layout = Layout(width='90%', height='150px')
PARADIM_UI['s1']['input'].disabled = True

PARADIM_UI['s1']['commands'] = ui.Text(description="commands",
                                       name="commands",
                                       value='''''')
PARADIM_UI['s1']['commands'].dd.layout = Layout(width='90%', height='150px')
PARADIM_UI['s1']['commands'].disabled = True

PARADIM_UI['s1']['stdin'] = ui.Text(description="stdin",
##################################################

PARADIM_UI['s1'] = {}
PARADIM_UI['s1']['ecutwfc'] = ui.String(name='ecutwfc',
                                        description='ecutwfc',
                                        value='100')
PARADIM_UI['s1']['ntyp'] = ui.String(name='ntyp',
                                     description='ntyp',
                                     value='1')
PARADIM_UI['s1']['nat'] = ui.String(name='nat', description='nat', value='2')
PARADIM_UI['s1']['celldm'] = ui.String(name='celldm',
                                       description='celldm',
                                       value='6.66405')

PARADIM_UI['s1']['input'] = ui.Text(description="inputdeck",
                                    name="inputdeck",
                                    value='''''')
PARADIM_UI['s1']['input'].dd.layout = Layout(width='90%', height='150px')
PARADIM_UI['s1']['input'].disabled = True

PARADIM_UI['s1']['commands'] = ui.Text(description="commands",
                                       name="commands",
                                       value='''''')
PARADIM_UI['s1']['commands'].dd.layout = Layout(width='90%', height='150px')
PARADIM_UI['s1']['commands'].disabled = True

PARADIM_UI['s1']['stdin'] = ui.Text(description="stdin",
                                    name="stdin",
                                    value='''''')
PARADIM_UI['s1']['stdin'].dd.layout = Layout(width='100%', height='300px')
PARADIM_UI['s1']['stdin'].disabled = True
示例#6
0
    SCGI_UI['s_0']['user2'],
    SCGI_UI['s_0']['pwd2'],
    SCGI_UI['s_0']['folder2'],
    HBox([SCGI_UI['s_0']['button']]),
    SCGI_UI['s_0']['status'],
],
                                    name='Credentials')

##################################################
# First
##################################################

SCGI_UI['s1'] = {}
SCGI_UI['s1']['ecutwfc'] = ui.String('ecutwfc', '40.0')
SCGI_UI['s1']['kpoints'] = ui.Text(name="kpoints",
                                   value='''automatic
6 6 6 1 1 1''')
SCGI_UI['s1']['kpoints'].dd.layout = Layout(height='120px')
SCGI_UI['s1']['input'] = ui.Text(name="inputdeck", value='''''')
SCGI_UI['s1']['input'].dd.layout = Layout(width='90%', height='150px')
SCGI_UI['s1']['input'].disabled = True

SCGI_UI['s1']['commands'] = ui.Text(name="commands", value='''''')
SCGI_UI['s1']['commands'].dd.layout = Layout(width='90%', height='150px')
SCGI_UI['s1']['commands'].disabled = True

SCGI_UI['s1']['stdin'] = ui.Text(name="stdin", value='''''')
SCGI_UI['s1']['stdin'].dd.layout = Layout(width='100%', height='300px')
SCGI_UI['s1']['stdin'].disabled = True

SCGI_UI['s1']['stdout'] = ui.Text(name="stdout", value='''''')
示例#7
0
''',
        'atomic_positions':
        '''
La       0.637550915   0.637550903   0.000000101
La       0.362449085   0.362449097  -0.000000101
O        0.818296061   0.818295711   0.000000189
O        0.181703939   0.181704289  -0.000000189
Ni       0.000000000   0.000000000   0.000000000
O        0.000002000   0.500002000   0.500003000
O        0.500002000   0.000002000   0.500003000
''',
    },
}

PARADIM_UI['s1']['commands'] = ui.Text(description="commands",
                                       name="commands",
                                       value='''''')
PARADIM_UI['s1']['commands'].dd.layout = Layout(width='99%', height='150px')
PARADIM_UI['s1']['commands'].disabled = True

PARADIM_UI['s1']['stdin'] = ui.Text(description="stdin",
                                    name="stdin",
                                    value='''''')
PARADIM_UI['s1']['stdin'].dd.layout = Layout(width='100%', height='300px')
PARADIM_UI['s1']['stdin'].disabled = True

PARADIM_UI['s1']['stdout'] = ui.Text(description="stdout",
                                     name="stdout",
                                     value='''''')
PARADIM_UI['s1']['stdout'].dd.layout = Layout(width='100%', height='300px')
PARADIM_UI['s1']['stdout'].disabled = True