Ejemplo n.º 1
0
    def getiddgroupdict(self):
        """Return a idd group dictionary
        sample: {'Plant-Condenser Loops': ['PlantLoop', 'CondenserLoop'],
        'Compliance Objects': ['Compliance:Building'], 'Controllers':
        ['Controller:WaterCoil',
        'Controller:OutdoorAir',
        'Controller:MechanicalVentilation',
        'AirLoopHVAC:ControllerList'],
        ...}

        Returns
        -------
        dict
        """
        return iddgroups.commdct2grouplist(self.idd_info)
Ejemplo n.º 2
0
 def getiddgroupdict(self):
     """Return a idd group dictionary
     sample: {'Plant-Condenser Loops': ['PlantLoop', 'CondenserLoop'],
      'Compliance Objects': ['Compliance:Building'], 'Controllers':
      ['Controller:WaterCoil',
       'Controller:OutdoorAir',
       'Controller:MechanicalVentilation',
       'AirLoopHVAC:ControllerList'], 
     ...}
     
     Returns
     -------
     dict 
     """
     return iddgroups.commdct2grouplist(self.idd_info)
Ejemplo n.º 3
0
def test_commdct2grouplist():
    """py.test for commdct2grouplist"""
    data = ((
    [
     [{'group':None, 'idfobj':'Lead Input'}],
     [{'group':None, 'idfobj':'Simulation Data'}],
     [{'group':'G1', 'idfobj':'Version', u'format': [u'singleLine'], u'unique-object': [u'']},
      {u'default': [u'7.0'],
       u'field': [u'Version Identifier'],
       u'required-field': [u'']}],
     [{'group':'G1', 'idfobj':'Version1', u'format': [u'singleLine'], u'unique-object': [u'']},
      {u'default': [u'7.0'],
       u'field': [u'Version Identifier'],
       u'required-field': [u'']}],
     [{'group':'G1', 'idfobj':'Version2', u'format': [u'singleLine'], u'unique-object': [u'']},
      {u'default': [u'7.0'],
       u'field': [u'Version Identifier'],
       u'required-field': [u'']}],
     [{'group':'G2', 'idfobj':'VersionG', u'format': [u'singleLine'], u'unique-object': [u'']},
      {u'default': [u'7.0'],
       u'field': [u'Version Identifier'],
       u'required-field': [u'']}],
     [{'group':'G2', 'idfobj':'VersionG1', u'format': [u'singleLine'], u'unique-object': [u'']},
      {u'default': [u'7.0'],
       u'field': [u'Version Identifier'],
       u'required-field': [u'']}],
     [{'group':'G2', 'idfobj':'VersionG2', u'format': [u'singleLine'], u'unique-object': [u'']},
      {u'default': [u'7.0'],
       u'field': [u'Version Identifier'],
       u'required-field': [u'']}]],
    {
        'G2': ['VersionG', 'VersionG1', 'VersionG2'],
        'G1': ['Version', 'Version1', 'Version2'],
        None: ['Lead Input', 'Simulation Data']
    },
    ), # gcommdct, gdict
    )
    for gcommdct, gdict in data:
        result = iddgroups.commdct2grouplist(gcommdct)
        assert result == gdict
Ejemplo n.º 4
0
def test_commdct2grouplist():
    """py.test for commdct2grouplist"""
    data = (
        (
            [[{
                'group': None,
                'idfobj': 'Lead Input'
            }], [{
                'group': None,
                'idfobj': 'Simulation Data'
            }],
             [{
                 'group': 'G1',
                 'idfobj': 'Version',
                 u'format': [u'singleLine'],
                 u'unique-object': [u'']
             }, {
                 u'default': [u'7.0'],
                 u'field': [u'Version Identifier'],
                 u'required-field': [u'']
             }],
             [{
                 'group': 'G1',
                 'idfobj': 'Version1',
                 u'format': [u'singleLine'],
                 u'unique-object': [u'']
             }, {
                 u'default': [u'7.0'],
                 u'field': [u'Version Identifier'],
                 u'required-field': [u'']
             }],
             [{
                 'group': 'G1',
                 'idfobj': 'Version2',
                 u'format': [u'singleLine'],
                 u'unique-object': [u'']
             }, {
                 u'default': [u'7.0'],
                 u'field': [u'Version Identifier'],
                 u'required-field': [u'']
             }],
             [{
                 'group': 'G2',
                 'idfobj': 'VersionG',
                 u'format': [u'singleLine'],
                 u'unique-object': [u'']
             }, {
                 u'default': [u'7.0'],
                 u'field': [u'Version Identifier'],
                 u'required-field': [u'']
             }],
             [{
                 'group': 'G2',
                 'idfobj': 'VersionG1',
                 u'format': [u'singleLine'],
                 u'unique-object': [u'']
             }, {
                 u'default': [u'7.0'],
                 u'field': [u'Version Identifier'],
                 u'required-field': [u'']
             }],
             [{
                 'group': 'G2',
                 'idfobj': 'VersionG2',
                 u'format': [u'singleLine'],
                 u'unique-object': [u'']
             }, {
                 u'default': [u'7.0'],
                 u'field': [u'Version Identifier'],
                 u'required-field': [u'']
             }]],
            {
                'G2': ['VersionG', 'VersionG1', 'VersionG2'],
                'G1': ['Version', 'Version1', 'Version2'],
                None: ['Lead Input', 'Simulation Data']
            },
        ),  # gcommdct, gdict
    )
    for gcommdct, gdict in data:
        result = iddgroups.commdct2grouplist(gcommdct)
        assert result == gdict
Ejemplo n.º 5
0
def test_commdct2grouplist():
    """py.test for commdct2grouplist"""
    data = (
        (
            [
                [{
                    "group": None,
                    "idfobj": "Lead Input"
                }],
                [{
                    "group": None,
                    "idfobj": "Simulation Data"
                }],
                [
                    {
                        "group": "G1",
                        "idfobj": "Version",
                        "format": ["singleLine"],
                        "unique-object": [""],
                    },
                    {
                        "default": ["7.0"],
                        "field": ["Version Identifier"],
                        "required-field": [""],
                    },
                ],
                [
                    {
                        "group": "G1",
                        "idfobj": "Version1",
                        "format": ["singleLine"],
                        "unique-object": [""],
                    },
                    {
                        "default": ["7.0"],
                        "field": ["Version Identifier"],
                        "required-field": [""],
                    },
                ],
                [
                    {
                        "group": "G1",
                        "idfobj": "Version2",
                        "format": ["singleLine"],
                        "unique-object": [""],
                    },
                    {
                        "default": ["7.0"],
                        "field": ["Version Identifier"],
                        "required-field": [""],
                    },
                ],
                [
                    {
                        "group": "G2",
                        "idfobj": "VersionG",
                        "format": ["singleLine"],
                        "unique-object": [""],
                    },
                    {
                        "default": ["7.0"],
                        "field": ["Version Identifier"],
                        "required-field": [""],
                    },
                ],
                [
                    {
                        "group": "G2",
                        "idfobj": "VersionG1",
                        "format": ["singleLine"],
                        "unique-object": [""],
                    },
                    {
                        "default": ["7.0"],
                        "field": ["Version Identifier"],
                        "required-field": [""],
                    },
                ],
                [
                    {
                        "group": "G2",
                        "idfobj": "VersionG2",
                        "format": ["singleLine"],
                        "unique-object": [""],
                    },
                    {
                        "default": ["7.0"],
                        "field": ["Version Identifier"],
                        "required-field": [""],
                    },
                ],
            ],
            {
                "G2": ["VersionG", "VersionG1", "VersionG2"],
                "G1": ["Version", "Version1", "Version2"],
                None: ["Lead Input", "Simulation Data"],
            },
        ),  # gcommdct, gdict
    )
    for gcommdct, gdict in data:
        result = iddgroups.commdct2grouplist(gcommdct)
        assert result == gdict