Skip to content

Commit

Permalink
switch to archive v3, issues are fixed now
Browse files Browse the repository at this point in the history
  • Loading branch information
simeonreusch committed Jan 25, 2023
1 parent e9bcbb2 commit cfd2e07
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 2 additions & 1 deletion nuztf/ampel_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from nuztf.credentials import load_credentials

API_BASEURL = "https://ampel.zeuthen.desy.de"
API_ZTF_ARCHIVE_URL = API_BASEURL + "/api/ztf/archive/v2"
API_ZTF_ARCHIVE_URL = API_BASEURL + "/api/ztf/archive/v3"
API_CATALOGMATCH_URL = API_BASEURL + "/api/catalogmatch"

_, ampel_api_archive_token = load_credentials("ampel_api_archive_token")
Expand Down Expand Up @@ -98,6 +98,7 @@ def ampel_api_cone(
queryurl_conesearch,
headers=headers,
)

if response.status_code == 503:
raise requests.exceptions.RequestException

Expand Down
4 changes: 1 addition & 3 deletions tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,7 @@ def test_api(self):
api_cutouts = ampel_api_cutout(candid=candid)
nr_cutouts = len(api_cutouts)

# setting the ref to 1 for now (this is a workaround and
# should be revisited when ArchiveDB v3 is stable)
ref = 1
ref = 5

self.logger.info(f"Retrieved {nr_cutouts}. Reference value is {ref}")

Expand Down

0 comments on commit cfd2e07

Please sign in to comment.