Skip to content

Commit

Permalink
Enable SSHG1G2 to be downloaded
Browse files Browse the repository at this point in the history
  • Loading branch information
JulienPeloton committed Oct 24, 2024
1 parent 7fc3e74 commit 4cb73fe
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
9 changes: 6 additions & 3 deletions apps/api/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
COLUMNS_HG,
COLUMNS_HG1G2,
COLUMNS_SHG1G2,
COLUMNS_SSHG1G2,
)
from fink_utils.xmatch.simbad import get_simbad_labels
from flask import Blueprint, Response, jsonify, request
Expand Down Expand Up @@ -588,7 +589,7 @@ def layout():
{
"name": "flavor",
"required": False,
"description": "Data model among SHG1G2 (default), HG1G2, HG.",
"description": "Data model among SSHG1G2, SHG1G2 (default), HG1G2, HG.",
},
{
"name": "version",
Expand Down Expand Up @@ -1529,12 +1530,14 @@ def ssoft_table(payload=None):
if "schema" in payload:
if "flavor" in payload:
flavor = payload["flavor"]
if flavor not in ["SHG1G2", "HG1G2", "HG"]:
if flavor not in ["SSHG1G2", "SHG1G2", "HG1G2", "HG"]:
rep = {
"status": "error",
"text": "flavor needs to be in ['SHG1G2', 'HG1G2', 'HG']\n",
"text": "flavor needs to be in ['SSHG1G2', 'SHG1G2', 'HG1G2', 'HG']\n",
}
return Response(str(rep), 400)
elif flavor == "SSHG1G2":
ssoft_columns = {**COLUMNS, **COLUMNS_SSHG1G2}
elif flavor == "SHG1G2":
ssoft_columns = {**COLUMNS, **COLUMNS_SHG1G2}
elif flavor == "HG1G2":
Expand Down
4 changes: 2 additions & 2 deletions apps/api/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1676,10 +1676,10 @@ def return_ssoft_pdf(payload: dict) -> pd.DataFrame:

if "flavor" in payload:
flavor = payload["flavor"]
if flavor not in ["SHG1G2", "HG1G2", "HG"]:
if flavor not in ["SSHG1G2", "SHG1G2", "HG1G2", "HG"]:
rep = {
"status": "error",
"text": "flavor needs to be in ['SHG1G2', 'HG1G2', 'HG']\n",
"text": "flavor needs to be in ['SSHG1G2', 'SHG1G2', 'HG1G2', 'HG']\n",
}
return Response(str(rep), 400)
else:
Expand Down

0 comments on commit 4cb73fe

Please sign in to comment.