Chang default legacy section name to 'Args'

Fix generated config file comment
This commit is contained in:
allegroai 2020-08-08 12:51:29 +03:00
parent b710c2f19d
commit 5fc641afc6
2 changed files with 4 additions and 2 deletions

View File

@ -61,6 +61,7 @@ class Task(IdObjectBase, AccessMixin, SetupUploadMixin):
_anonymous_dataview_id = '__anonymous__'
_development_tag = 'development'
_default_configuration_section_name = 'General'
_legacy_parameters_section_name = 'Args'
_force_requirements = {}
_store_diff = config.get('development.store_uncommitted_code_diff', False)
@ -796,7 +797,7 @@ class Task(IdObjectBase, AccessMixin, SetupUploadMixin):
else:
for section in hyperparams:
for key, section_param in hyperparams[section].items():
if section_param.type == 'legacy' and section in (self._default_configuration_section_name, ):
if section_param.type == 'legacy' and section in (self._legacy_parameters_section_name, ):
parameters['{}'.format(key)] = section_param.value
else:
parameters['{}/{}'.format(section, key)] = section_param.value
@ -877,7 +878,7 @@ class Task(IdObjectBase, AccessMixin, SetupUploadMixin):
org_hyperparams = self.data.hyperparams or {}
hyperparams = dict()
# if the task is a legacy task, we should put everything back under General/key with legacy type
legacy_name = self._default_configuration_section_name
legacy_name = self._legacy_parameters_section_name
org_legacy_section = org_hyperparams.get(legacy_name, dict())
for k, v in parameters.items():

View File

@ -137,6 +137,7 @@ def main():
' web_server: %s\n' \
' files_server: %s\n' \
' # Credentials are generated using the webapp, %s/profile\n' \
' # Override with os environment: TRAINS_API_ACCESS_KEY / TRAINS_API_SECRET_KEY\n' \
' credentials {"access_key": "%s", "secret_key": "%s"}\n' \
'}\n' \
'sdk ' % (api_host, web_host, files_host,