diff --git a/nomad/app/api/archive.py b/nomad/app/api/archive.py index 589e045ac6901110a5315d886c523a6dd67c1677..e10c46ee78f9fa12fe2fb361f03bdd562ea5174b 100644 --- a/nomad/app/api/archive.py +++ b/nomad/app/api/archive.py @@ -217,16 +217,7 @@ add_pagination_parameters(_archive_query_parser) add_scroll_parameters(_archive_query_parser) add_search_parameters(_archive_query_parser) -_archive_query_model_fields = { - 'results': fields.List(fields.Raw, description=( - 'A list of search results. Each result is a dict with quantities names as key and ' - 'values as values')), - 'python': fields.String(description=( - 'A string of python code snippet which can be executed to reproduce the api result.')), - 'curl': fields.String(description=( - 'A string of curl command which can be executed to reproduce the api result.')), -} -_archive_query_model = api.inherit('ArchiveCalculations', search_model, _archive_query_model_fields) +_archive_query_model = api.inherit('ArchiveCalculations', search_model) @ns.route('/query') diff --git a/nomad/app/api/common.py b/nomad/app/api/common.py index a0632ab0da5d6c80db8c502f6fc7bd440f9c4595..6d7a312a4e067c14b5255b1fa2535b385ad9cfe5 100644 --- a/nomad/app/api/common.py +++ b/nomad/app/api/common.py @@ -65,6 +65,10 @@ search_model = api.model('Search', { 'results': fields.List(fields.Raw, description=( 'A list of search results. Each result is a dict with quantitie names as key and ' 'values as values')), + 'python': fields.String(description=( + 'A string of python code snippet which can be executed to reproduce the api result.')), + 'curl': fields.String(description=( + 'A string of curl command which can be executed to reproduce the api result.')) }) diff --git a/nomad/app/api/repo.py b/nomad/app/api/repo.py index 23a34b31debf564d996ff12d15664f1457b75d44..54d6d4c175c4334dd4a9f93084a1621342644670 100644 --- a/nomad/app/api/repo.py +++ b/nomad/app/api/repo.py @@ -98,11 +98,7 @@ _repo_calcs_model_fields = { 'A dict with all statistics. Each statistic is dictionary with a metrics dict as ' 'value and quantity value as key. The possible metrics are code runs(calcs), %s. ' 'There is a pseudo quantity "total" with a single value "all" that contains the ' - ' metrics over all results. ' % ', '.join(datamodel.Domain.instance.metrics_names))), - 'python': fields.String(description=( - 'A string of python code snippet which can be executed to reproduce the api result.')), - 'curl': fields.String(description=( - 'A string of curl command which can be executed to reproduce the api result.')), + ' metrics over all results. ' % ', '.join(datamodel.Domain.instance.metrics_names))) } for group_name, (group_quantity, _) in search.groups.items(): _repo_calcs_model_fields[group_name] = fields.Nested(api.model('RepoDatasets', {