Ejemplo n.º 1
0
    def check_default_config(self):
        """Check for a configuration inside the default paths."""
        config = orion.core.config.to_dict()

        backward.update_db_config(config)

        if "database" not in config.get("storage", {}):
            return "Skipping", "No default configuration found for database."

        self.db_config = config["storage"]["database"]
        print("\n   ", self.db_config)

        return "Success", ""
Ejemplo n.º 2
0
def get_cmd_config(cmdargs):
    """Fetch configuration defined by commandline and local configuration file.

    Arguments of commandline have priority over options in configuration file.
    """
    cmdargs = resolve_config.fetch_config_from_cmdargs(cmdargs)
    cmd_config = resolve_config.fetch_config(cmdargs)
    cmd_config = resolve_config.merge_configs(cmd_config, cmdargs)

    cmd_config.update(cmd_config.pop("experiment", {}))
    cmd_config["user_script_config"] = cmd_config.get("worker", {}).get(
        "user_script_config", None
    )

    cmd_config["branching"] = cmd_config.pop("evc", {})

    # TODO: We should move branching specific stuff below in a centralized place for EVC stuff.
    if (
        cmd_config["branching"].get("auto_resolution", False)
        and cmdargs.get("manual_resolution", None) is None
    ):
        cmd_config["branching"]["manual_resolution"] = False

    non_monitored_arguments = cmdargs.get("non_monitored_arguments")
    if non_monitored_arguments:
        cmd_config["branching"][
            "non_monitored_arguments"
        ] = non_monitored_arguments.split(":")

    # TODO: user_args won't be defined if reading from DB only (`orion hunt -n <exp> ` alone)
    metadata = resolve_config.fetch_metadata(
        cmd_config.get("user"),
        cmd_config.get("user_args"),
        cmd_config.get("user_script_config"),
    )
    cmd_config["metadata"] = metadata
    cmd_config.pop("config", None)

    cmd_config["space"] = cmd_config["metadata"].get("priors", None)

    backward.update_db_config(cmd_config)

    return cmd_config
Ejemplo n.º 3
0
def get_cmd_config(cmdargs):
    """Fetch configuration defined by commandline and local configuration file.

    Arguments of commandline have priority over options in configuration file.
    """
    cmdargs = resolve_config.fetch_config_from_cmdargs(cmdargs)
    cmd_config = resolve_config.fetch_config(cmdargs)
    cmd_config = resolve_config.merge_configs(cmd_config, cmdargs)

    cmd_config.update(cmd_config.pop('experiment', {}))
    cmd_config['branching'] = cmd_config.pop('evc', {})

    metadata = resolve_config.fetch_metadata(cmd_config.get('user'),
                                             cmd_config.get('user_args'))
    cmd_config['metadata'] = metadata
    cmd_config.pop('config', None)

    backward.populate_space(cmd_config)
    backward.update_db_config(cmd_config)

    return cmd_config
Ejemplo n.º 4
0
 def mock_file_config(cmdargs):
     backward.update_db_config(config)
     return config