Example #1
0
    def __init__(
        self,
        caseroot=None,
        infile="env_mach_specific.xml",
        components=None,
        unit_testing=False,
        read_only=False,
        standalone_configure=False,
        comp_interface=None,
    ):
        """
        initialize an object interface to file env_mach_specific.xml in the case directory

        Notes on some arguments:
        standalone_configure: logical - whether this is being called from the standalone
            configure utility, outside of a case
        """
        schema = os.path.join(utils.get_schema_path(), "env_mach_specific.xsd")
        EnvBase.__init__(self,
                         caseroot,
                         infile,
                         schema=schema,
                         read_only=read_only)
        self._allowed_mpi_attributes = (
            "compiler",
            "mpilib",
            "threaded",
            "unit_testing",
            "queue",
            "comp_interface",
        )
        self._comp_interface = comp_interface
        self._unit_testing = unit_testing
        self._standalone_configure = standalone_configure
Example #2
0
    def __init__(self, comp_interface=None):
        """
        initialize an object

        >>> files = Files()
        >>> files.get_value('CASEFILE_HEADERS',resolved=False)
        '$CIMEROOT/CIME/data/config/config_headers.xml'
        """
        if comp_interface is None:
            comp_interface = "mct"
        cimeroot = get_cime_root()
        cimeroot_parent = os.path.dirname(cimeroot)
        config_path = get_config_path()
        schema_path = get_schema_path()

        infile = os.path.join(config_path, get_model(), "config_files.xml")
        expect(os.path.isfile(infile), "Could not find or open file {}".format(infile))

        schema = os.path.join(schema_path, "entry_id.xsd")

        EntryID.__init__(self, infile, schema=schema)

        config_files_override = os.path.join(cimeroot_parent, ".config_files.xml")
        # variables COMP_ROOT_DIR_{} are mutable, all other variables are read only
        self.COMP_ROOT_DIR = {}
        self._comp_interface = comp_interface
        self._cpl_comp = {}
        # .config_file.xml at the top level may overwrite COMP_ROOT_DIR_ nodes in config_files

        if os.path.isfile(config_files_override):
            self.read(config_files_override)
            self.overwrite_existing_entries()
Example #3
0
 def __init__(
     self, case_root=None, infile="env_case.xml", components=None, read_only=False
 ):
     """
     initialize an object interface to file env_case.xml in the case directory
     """
     schema = os.path.join(utils.get_schema_path(), "env_entry_id.xsd")
     EnvBase.__init__(self, case_root, infile, schema=schema, read_only=read_only)
Example #4
0
    def __init__(
        self,
        case_root=None,
        infile="env_mach_pes.xml",
        components=None,
        read_only=False,
        comp_interface="mct",
    ):
        """
        initialize an object interface to file env_mach_pes.xml in the case directory
        """
        self._components = components
        self._comp_interface = comp_interface

        schema = os.path.join(utils.get_schema_path(), "env_mach_pes.xsd")
        EnvBase.__init__(self,
                         case_root,
                         infile,
                         schema=schema,
                         read_only=read_only)
Example #5
0
 def __init__(self, infile):
     schema = os.path.join(utils.get_schema_path(),
                           "expected_fails_file.xsd")
     GenericXML.__init__(self, infile, schema=schema)