Skip to content

Commit

Permalink
Add contextinfo to get_body_scaffold_info endpoint's response.
Browse files Browse the repository at this point in the history
  • Loading branch information
alan-wu committed Sep 17, 2023
1 parent 14ea83a commit d457f60
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/scicrunch_process_results.py
Expand Up @@ -80,10 +80,13 @@ def process_get_first_scaffold_info(results):
if 'abi-scaffold-metadata-file' in result and len(result['abi-scaffold-metadata-file']) > 0:
try:
path = result['abi-scaffold-metadata-file'][0]['dataset']['path']
context_info = ''
if len(result['abi-context-file']) > 0:
context_info = result['abi-context-file'][0]['dataset']['path']
id = result['dataset_identifier']
version = result['dataset_version']
s3uri = result['s3uri']
return jsonify({'path':path, 'id': id, 'version': version, 's3uri': s3uri})
return jsonify({'path':path, 'id': id, 'version': version, 's3uri': s3uri, 'contextinfo': context_info})
except KeyError:
return None

Expand Down
1 change: 1 addition & 0 deletions tests/test_scicrunch.py
Expand Up @@ -431,6 +431,7 @@ def test_get_body_scaffold_info(client):
result = json.loads(r.data)
assert result['id'] == '307'
assert result['path'] == 'derivative/human_body_metadata.json'
assert result['contextinfo'] == 'derivative/scaffold_context_info.json'
assert 'prd-sparc-discover-use1' in result['s3uri']

def test_getting_curies(client):
Expand Down

0 comments on commit d457f60

Please sign in to comment.