smac.utils.io.cmd_reader¶
Functions
Convert cost for crash into an array. |
|
Convert objectives into an array. |
|
|
Convert x into its truth value. |
Classes
Use argparse to parse command line options. |
|
|
Check scenario file given by user. |
|
Configurable Help Formatter. |
|
Action to show standard and developer options in help message. |
|
Parse overall objective given by user. |
|
Parse random configuration chooser given by user. |
|
Process output directory given by user. |
|
Process run objective given by user. |
|
Read feature file given by user. |
|
Read PCS (parameter configuration space) file given by user. |
|
Read test instance file given by user. |
|
Read training instance file given by user. |
|
ArgumentParser that can be extended by additional parsers. |
|
Action to only show standard options in help message. |
- class smac.utils.io.cmd_reader.CMDReader[source]¶
Bases:
object
Use argparse to parse command line options.
- logger¶
- Type
Logger
- parse_main_command(main_cmd_opts)[source]¶
Parse main options.
- Return type
Tuple
[Namespace
,List
[str
]]
- parse_scenario_command(scenario_file=None, scenario_dict={}, scenario_cmd_opts=[])[source]¶
Parses scenario options.
- Parameters
scenario_file (str, optional) – Path to the scenario file, by default None
scenario_dict (dict, optional) – Mappings of scenario options to values, by default {}
scenario_cmd_opts (List[str], optional) – Scenario options from command line, by default []
- Returns
Parsed scenario arguments.
- Return type
Namespace
- Raises
ValueError – If scenario is not a string or dictionary.
- parse_smac_command(smac_dict={}, smac_cmd_opts=[])[source]¶
Parse SMAC options.
- Return type
Tuple
[Namespace
,Dict
,List
[str
]]
- read_cmd(commandline_arguments=('-b', 'html', '.', 'build/html'))[source]¶
Reads command line options (main, smac and scenario options)
- Returns
smac_args_, scen_args_ – main, smac and scenario options parsed with corresponding ArgumentParser
- Return type
parsed arguments;
- read_smac_scenario_dict_cmd(dict_cmd, scenario_file=None)[source]¶
Reads smac and scenario options provided in a dictionary.
- Returns
smac_args_, scen_args_
- Return type
smac and scenario options parsed with corresponding ArgumentParser
- write_main_options_to_doc(path='main_options.rst')[source]¶
Writes the SMAC option-list to file for autogeneration in documentation. The list is created in doc/conf.py and read in doc/options.rst.
- Parameters
path (string) – Where to write to (relative to doc-folder since executed in conf.py)
- Return type
None
- write_scenario_options_to_doc(path='scenario_options.rst')[source]¶
Writes the Scenario option-list to file for autogeneration in documentation. The list is created in doc/conf.py and read in doc/options.rst.
- Parameters
path (string) – Where to write to (relative to doc-folder since executed in conf.py)
- Return type
None
- write_smac_options_to_doc(path='smac_options.rst')[source]¶
Writes the SMAC option-list to file for autogeneration in documentation. The list is created in doc/conf.py and read in doc/options.rst.
- Parameters
path (string) – Where to write to (relative to doc-folder since executed in conf.py)
- Return type
None
- class smac.utils.io.cmd_reader.CheckScenarioFileAction(option_strings, dest, nargs=None, const=None, default=None, type=None, choices=None, required=False, help=None, metavar=None)[source]¶
Bases:
argparse.Action
Check scenario file given by user.
- class smac.utils.io.cmd_reader.ConfigurableHelpFormatter(*args, help_type='standard', **kwargs)[source]¶
Bases:
argparse.ArgumentDefaultsHelpFormatter
Configurable Help Formatter. Can filter out developer options.
- class smac.utils.io.cmd_reader.DevHelpAction(*args, **kwargs)[source]¶
Bases:
argparse.Action
Action to show standard and developer options in help message.
- class smac.utils.io.cmd_reader.ParseOverallObjectiveAction(option_strings, dest, nargs=None, const=None, default=None, type=None, choices=None, required=False, help=None, metavar=None)[source]¶
Bases:
argparse.Action
Parse overall objective given by user.
- class smac.utils.io.cmd_reader.ParseRandomConfigurationChooserAction(option_strings, dest, nargs=None, const=None, default=None, type=None, choices=None, required=False, help=None, metavar=None)[source]¶
Bases:
argparse.Action
Parse random configuration chooser given by user.
- class smac.utils.io.cmd_reader.ProcessOutputDirAction(option_strings, dest, nargs=None, const=None, default=None, type=None, choices=None, required=False, help=None, metavar=None)[source]¶
Bases:
argparse.Action
Process output directory given by user.
- class smac.utils.io.cmd_reader.ProcessRunObjectiveAction(option_strings, dest, nargs=None, const=None, default=None, type=None, choices=None, required=False, help=None, metavar=None)[source]¶
Bases:
argparse.Action
Process run objective given by user.
- class smac.utils.io.cmd_reader.ReadFeatureFileAction(option_strings, dest, nargs=None, const=None, default=None, type=None, choices=None, required=False, help=None, metavar=None)[source]¶
Bases:
argparse.Action
Read feature file given by user.
- class smac.utils.io.cmd_reader.ReadPCSFileAction(option_strings, dest, nargs=None, const=None, default=None, type=None, choices=None, required=False, help=None, metavar=None)[source]¶
Bases:
argparse.Action
Read PCS (parameter configuration space) file given by user.
- class smac.utils.io.cmd_reader.ReadTestInstFileAction(option_strings, dest, nargs=None, const=None, default=None, type=None, choices=None, required=False, help=None, metavar=None)[source]¶
Bases:
argparse.Action
Read test instance file given by user.
- class smac.utils.io.cmd_reader.ReadTrainInstFileAction(option_strings, dest, nargs=None, const=None, default=None, type=None, choices=None, required=False, help=None, metavar=None)[source]¶
Bases:
argparse.Action
Read training instance file given by user.
- class smac.utils.io.cmd_reader.SMACArgumentParser(*args, **kwargs)[source]¶
Bases:
argparse.ArgumentParser
ArgumentParser that can be extended by additional parsers.
- class smac.utils.io.cmd_reader.StandardHelpAction(*args, **kwargs)[source]¶
Bases:
argparse.Action
Action to only show standard options in help message.
- smac.utils.io.cmd_reader.cost_for_crash(x)[source]¶
Convert cost for crash into an array.
- Return type
Union
[int
,float
,List
[Union
[int
,float
]]]