Bases: object

Writing scenario to file.

_parse_argument(scenario: Scenario, key: str, value: Any) Any

Some values of the scenario-file need to be changed upon writing, such as the ‘ta’ (target algorithm), due to it’s callback. Also, the configspace, features, train_inst- and test-inst-lists are saved to output_dir, if they exist.

Sideeffects - copies files pcs_fn, train_inst_fn, test_inst_fn and feature_fn to output if possible, creates the files from attributes otherwise

  • scenario (Scenario) – Scenario-file to be written

  • key (string) – Name of the attribute in scenario-file

  • value (Any) – Corresponding attribute


new value – The altered value, to be written to file

Return type


save_configspace(cs: ConfigSpace.configuration_space.ConfigurationSpace, fn: str, output_format: str) None

Writing ConfigSpace to file.

  • cs (ConfigurationSpace) – Config-space to be written

  • fn (str) – Output-file-path

  • output_format (str) – Output format of the configuration space file. Currently, json and pcs_new are supported.

write_inst_features_file(n_features: int, feat_dict: Dict[str, Iterable[float]], fn: str) None

Writes features to file.

  • n_features (int) – Number of features

  • feat_dict (dict) – Features to be written

  • fn (string) – File name of instance feature file

write_inst_file(insts: List[str], fn: str) None

Writes instance-list to file.

  • insts (list<string>) – Instance list to be written

  • fn (string) – Output path

write_scenario_file(scenario: Scenario) None

Write scenario to a file (format is compatible with input_reader). Will overwrite if file exists. If you have arguments that need special parsing when saving, specify so in the _parse_argument-function. Creates output-dir if necessesary.


scenario (Scenario) – Scenario to be written to file


status – False indicates that writing process failed

Return type

False or None