当前位置: 首页>>代码示例>>Python>>正文


Python env_base.EnvBase类代码示例

本文整理汇总了Python中CIME.XML.env_base.EnvBase的典型用法代码示例。如果您正苦于以下问题:Python EnvBase类的具体用法?Python EnvBase怎么用?Python EnvBase使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了EnvBase类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

 def __init__(self, case_root=None, infile="env_batch.xml"):
     """
     initialize an object interface to file env_batch.xml in the case directory
     """
     EnvBase.__init__(self, case_root, infile)
     self.prereq_jobid = None
     self.batchtype = None
开发者ID:ekluzek,项目名称:cime,代码行数:7,代码来源:env_batch.py

示例2: __init__

 def __init__(self, case_root=None, infile="env_mach_pes.xml", components=None):
     """
     initialize an object interface to file env_mach_pes.xml in the case directory
     """
     self._components = components
     schema = os.path.join(get_cime_root(), "config", "xml_schemas", "env_mach_pes.xsd")
     EnvBase.__init__(self, case_root, infile, schema=schema)
开发者ID:apcraig,项目名称:cime,代码行数:7,代码来源:env_mach_pes.py

示例3: get_nodes

 def get_nodes(self, nodename, attributes=None, root=None, xpath=None):
     if nodename in ("JOB_WALLCLOCK_TIME", "PROJECT", "PROJECT_REQUIRED",
                     "JOB_QUEUE", "BATCH_COMMAND_FLAGS"):
         nodes = EnvBase.get_nodes(self, "entry", attributes={"id":nodename},
                                     root=root, xpath=xpath)
     else:
         nodes =  EnvBase.get_nodes(self, nodename, attributes, root, xpath)
     return nodes
开发者ID:apcraig,项目名称:cime,代码行数:8,代码来源:env_batch.py

示例4: get_children

    def get_children(self, name=None, attributes=None, root=None):
        if name in ("JOB_WALLCLOCK_TIME", "PROJECT", "CHARGE_ACCOUNT",
                        "PROJECT_REQUIRED", "JOB_QUEUE", "BATCH_COMMAND_FLAGS"):
            nodes = EnvBase.get_children(self, "entry", attributes={"id":name}, root=root)
        else:
            nodes = EnvBase.scan_children(self, name, attributes=attributes, root=root)

        return nodes
开发者ID:Katetc,项目名称:cime,代码行数:8,代码来源:env_batch.py

示例5: __init__

    def __init__(self, case_root=None, infile="env_run.xml", components=None, read_only=False):
        """
        initialize an object interface to file env_run.xml in the case directory
        """
        self._components = components
        schema = os.path.join(get_cime_root(), "config", "xml_schemas", "env_entry_id.xsd")

        EnvBase.__init__(self, case_root, infile, schema=schema, read_only=read_only)
开发者ID:fischer-ncar,项目名称:cime,代码行数:8,代码来源:env_run.py

示例6: __init__

 def __init__(self, caseroot, infile="env_mach_specific.xml"):
     """
     initialize an object interface to file env_mach_specific.xml in the case directory
     """
     fullpath = infile if os.path.isabs(infile) else os.path.join(caseroot, infile)
     EnvBase.__init__(self, caseroot, fullpath)
     self._cshscript = []
     self._shscript = []
开发者ID:quantheory,项目名称:cime,代码行数:8,代码来源:env_mach_specific.py

示例7: __init__

 def __init__(self, case_root=None, infile="env_batch.xml"):
     """
     initialize an object interface to file env_batch.xml in the case directory
     """
     self._batchtype = None
     # This arbitrary setting should always be overwritten
     self._default_walltime = "00:20:00"
     schema = os.path.join(get_cime_root(), "config", "xml_schemas", "env_batch.xsd")
     EnvBase.__init__(self, case_root, infile, schema=schema)
开发者ID:Katetc,项目名称:cime,代码行数:9,代码来源:env_batch.py

示例8: __init__

 def __init__(self, caseroot=None, infile="env_mach_specific.xml",
              components=None, unit_testing=False):
     """
     initialize an object interface to file env_mach_specific.xml in the case directory
     """
     schema = os.path.join(get_cime_root(), "config", "xml_schemas", "env_mach_specific.xsd")
     EnvBase.__init__(self, caseroot, infile, schema=schema)
     self._allowed_mpi_attributes = ("compiler", "mpilib", "threaded", "unit_testing")
     self._unit_testing = unit_testing
开发者ID:apcraig,项目名称:cime,代码行数:9,代码来源:env_mach_specific.py

示例9: __init__

 def __init__(self, case_root=None, infile="env_batch.xml"):
     """
     initialize an object interface to file env_batch.xml in the case directory
     """
     EnvBase.__init__(self, case_root, infile)
     self.prereq_jobid = None
     self.batchtype = None
     # This arbitrary setting should always be overwritten
     self._default_walltime = "00:20:00"
开发者ID:cacraigucar,项目名称:cime-cacraig,代码行数:9,代码来源:env_batch.py

示例10: get_value

    def get_value(self, item, attribute=None, resolved=True, subgroup="case.run"):
        """
        Must default subgroup to something in order to provide single return value
        """
        value = None
        if subgroup is None:
            node = self.get_optional_node(item, attribute)
            if node is not None:
                value = node.text
                if resolved:
                    value = self.get_resolved_value(value)
            else:
                value = EnvBase.get_value(self,item,attribute,resolved)
        else:
            job_node = self.get_optional_node("job", {"name":subgroup})
            if job_node is not None:
                node = self.get_optional_node("entry", {"id":item}, root=job_node)
                if node is not None:
                    value = node.get("value")
                    if resolved:
                        value = self.get_resolved_value(value)

                    # Return value as right type if we were able to fully resolve
                    # otherwise, we have to leave as string.
                    if "$" not in value:
                        type_str = self._get_type_info(node)
                        value = convert_to_type(value, type_str, item)
        return value
开发者ID:cacraigucar,项目名称:cime-cacraig,代码行数:28,代码来源:env_batch.py

示例11: get_value

 def get_value(self, vid, attribute=None, resolved=True, subgroup=None):
     value = EnvBase.get_value(self, vid, attribute, resolved, subgroup)
     if value is None:
         tnode = self.get_optional_child("test")
         if tnode is not None:
             value = self.get_element_text(vid, root=tnode)
     return value
开发者ID:fischer-ncar,项目名称:cime,代码行数:7,代码来源:env_test.py

示例12: get_value

    def get_value(self, item, attribute=None, resolved=True, subgroup="case.run"):
        """
        Must default subgroup to something in order to provide single return value
        """

        value = None
        if subgroup is None:
            node = self.get_optional_child(item, attribute)
            if node is not None:
                value = self.text(node)
                if resolved:
                    value = self.get_resolved_value(value)
            else:
                value = EnvBase.get_value(self,item,attribute,resolved)
        else:
            value = EnvBase.get_value(self, item, attribute=attribute, resolved=resolved, subgroup=subgroup)

        return value
开发者ID:Katetc,项目名称:cime,代码行数:18,代码来源:env_batch.py

示例13: get_value

 def get_value(self, vid, attribute={}, resolved=True, subgroup=None):
     value = EnvBase.get_value(self, vid, attribute, resolved, subgroup)
     if "NTASKS" in vid and value < 0:
         value = -1*value*self.get_value("PES_PER_NODE")
     if "NTHRDS" in vid and value < 0:
         value = -1*value*self.get_value("PES_PER_NODE")
     if "ROOTPE" in vid and value < 0:
         value = -1*value*self.get_value("PES_PER_NODE")
     return value
开发者ID:quantheory,项目名称:cime,代码行数:9,代码来源:env_mach_pes.py

示例14: get_value

    def get_value(self, vid, attribute=None, resolved=True, subgroup=None, pes_per_node=None): # pylint: disable=arguments-differ
        value = EnvBase.get_value(self, vid, attribute, resolved, subgroup)
        if "NTASKS" in vid or "ROOTPE" in vid and pes_per_node is None:
            pes_per_node = self.get_value("PES_PER_NODE")

            if "NTASKS" in vid and value < 0:
                value = -1*value*pes_per_node
            if "ROOTPE" in vid and value < 0:
                value = -1*value*pes_per_node
        return value
开发者ID:ekluzek,项目名称:cime,代码行数:10,代码来源:env_mach_pes.py

示例15: get_value

    def get_value(self, item, attribute=None, resolved=True, subgroup="case.run"):
        """
        Must default subgroup to something in order to provide single return value
        """

        value = None
        if subgroup is None:
            nodes = self.get_nodes(item, attribute)
            if len(nodes) == 1:
                node = nodes[0]
                value = node.text
                if resolved:
                    value = self.get_resolved_value(value)
            elif not nodes:
                value = EnvBase.get_value(self,item,attribute,resolved)
        else:
            value = EnvBase.get_value(self, item, attribute=attribute, resolved=resolved, subgroup=subgroup)

        return value
开发者ID:apcraig,项目名称:cime,代码行数:19,代码来源:env_batch.py


注:本文中的CIME.XML.env_base.EnvBase类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。