Skip to content

Fix type field #12

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions app/api/models/resolver.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Optional, Literal, List
from typing import Optional, Literal, List, Dict
from pydantic import BaseModel, Field


Expand Down Expand Up @@ -31,7 +31,8 @@ class MetadataResult(BaseModel):
assembly: Assembly
scientific_name: str
common_name: str
type: Optional[str] = None
type: Optional[Dict[str, str]] = None
is_reference: bool = False


class ResolvedPayload(MetadataResult):
Expand Down
13 changes: 11 additions & 2 deletions app/api/resources/templates/search_results.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,17 @@ <h1>Resolved URLs</h1>
<td>{{ item.assembly.accession_id }}</td>
<td>{{ item.scientific_name }}</td>
<td>{{ item.common_name }}</td>
<td>{{ item.species }}</td>
<td>{{ item.type }}</td>
<td>
{% if item.type and item.is_reference %}
{{ item.type.kind }} - {{ item.type.value }}, Reference
{% elif item.is_reference %}
Reference
{% elif item.type %}
{{ item.type.kind }} - {{ item.type.value }}
{% else %}
-
{% endif %}
</td>
<td>
<a href="{{ item.resolved_url }}">Ensembl</a>
</td>
Expand Down
3 changes: 3 additions & 0 deletions app/static/APISpecification.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ paths:
resolved_url:
type: string
description: Resolved url to Ensembl site
is_reference:
type: boolean
description: Whether a genome is reference or not
'302':
description: Redirect to resolved URL
headers:
Expand Down
5 changes: 2 additions & 3 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
-r requirements.txt
pre-commit=3.8.0
black=24.8.0
flake8==7.1.1
pre-commit==3.8.0
black==24.8.0