SpaceBuilder currently has the following constraints:
Can only detect config file if passed at position 0 or as --config= (Only support option config and must be passed with =, space does not work)
Can only detect parameters through --<name>~<prior>, cannot detect --<name> 'orion~<prior>' or --params '<name>~<prior>' '<name>~<prior>'.
Cannot support flexible exposed properties. Only supports --<name>~<exposed property>. It should support a standard template like ${exposed property} so that user can mark templates wherever they want to (option name, part of value, list of values, etc).
We should refactor the parsing of the commandline to first disentangle it from SpaceBuilder, and than we could add templating features so that in addition to parsing configs out of the command-line, we can support special templates to define in a flexible way configuration files, exposed properties or parameters.
[x] CmdlineParser.parse(commandline) method to extraction configuration and build a template in a generic way. No notion of parameters, of
[x] CmdlineParser.format(configuration) method to create a new commandline based on the template created by CmdlineParser.parse and the passed configuration
[x] SpaceBuilder.parse(configuration) method to parse a generic configuration extracted from CmdlineParser and extract config or parameters.
[x] SpaceBuilder._parse_args(configuration) could go as
Replace any --<name>~<prior> by --<name> 'orion~<prior>'
configuration = CmdlineParser.parse(commandline)
SpaceBuilder.parse(configuration)
[x] SpaceBuilder.format(trial_config) (_build_args) method to create a new commandline.
This one would go as:
Build generic commandline with new_commandline = CmdlineParser.format(trial_config)
Note: trial_config was built from SpaceBuilder.parse(CmdlineParser.parse(commandline)) so it will contain templates passed from user
Fill templates that was inserted in commandline at previous step.
ex: new_commandline.format(trial=trial, config=config_file)
SpaceBuilder currently has the following constraints:
--config=
(Only support option config and must be passed with=
, space does not work)--<name>~<prior>
, cannot detect--<name> 'orion~<prior>'
or--params '<name>~<prior>' '<name>~<prior>'
.--<name>~<exposed property>
. It should support a standard template like${exposed property}
so that user can mark templates wherever they want to (option name, part of value, list of values, etc).We should refactor the parsing of the commandline to first disentangle it from SpaceBuilder, and than we could add templating features so that in addition to parsing configs out of the command-line, we can support special templates to define in a flexible way configuration files, exposed properties or parameters.
CmdlineParser.parse(commandline)
method to extraction configuration and build a template in a generic way. No notion of parameters, ofCmdlineParser.format(configuration)
method to create a new commandline based on the template created byCmdlineParser.parse
and the passed configurationSpaceBuilder.parse(configuration)
method to parse a generic configuration extracted fromCmdlineParser
and extractconfig
or parameters.SpaceBuilder._parse_args(configuration)
could go as--<name>~<prior>
by--<name> 'orion~<prior>'
configuration = CmdlineParser.parse(commandline)
SpaceBuilder.parse(configuration)
SpaceBuilder.format(trial_config)
(_build_args
) method to create a new commandline. This one would go as:new_commandline = CmdlineParser.format(trial_config)
Note: trial_config was built fromSpaceBuilder.parse(CmdlineParser.parse(commandline))
so it will contain templates passed from usernew_commandline.format(trial=trial, config=config_file)