Skip to content

Commit

Permalink
improve formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
mam10eks committed Sep 24, 2024
1 parent 445abd9 commit fc9d6ea
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 5 deletions.
2 changes: 1 addition & 1 deletion application/src/manage.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
"""Django's command-line utility for administrative tasks."""
import os
import sys
Expand Down
16 changes: 12 additions & 4 deletions python-client/tira/rest_api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,22 @@

import pandas as pd
import requests
from tqdm import tqdm

from tira.local_execution_integration import LocalExecutionIntegration
from tira.pandas_integration import PandasIntegration
from tira.profiling_integration import ProfilingIntegration
from tira.pyterrier_integration import PyTerrierAnceIntegration, PyTerrierIntegration, PyTerrierSpladeIntegration
from tira.pyterrier_integration import (
PyTerrierAnceIntegration,
PyTerrierIntegration,
PyTerrierSpladeIntegration,
)
from tira.tira_redirects import (
RESOURCE_REDIRECTS,
TASKS_WITH_REDIRECT_MERGING,
dataset_ir_redirects,
mirror_url,
redirects,
)
from tqdm import tqdm

from .tira_client import TiraClient

Expand Down Expand Up @@ -131,7 +134,7 @@ def all_softwares(self, task_id):
]

def all_tasks(self):
return self.json_response(f'/tira-backend/api/task-list')['context']['task_list']
return self.json_response(f"/tira-backend/api/task-list")["context"]["task_list"]

def docker_software(self, approach):
task, team, software = approach.split("/")
Expand Down Expand Up @@ -401,6 +404,11 @@ def get_run_execution_or_none(self, approach, dataset, previous_stage_run_id=Non
if public_runs:
return {"task": task, "dataset": dataset, "team": team, "run_id": public_runs["runs"][0]}

if not self.api_key_is_valid():
raise ValueError(
f'No public submissions for "{approach} on "{dataset}" and you are not authenticated. Please authenticate to access private submissions'
)

df_eval = self.submissions_of_team(task=task, dataset=dataset, team=team)
if len(df_eval) <= 0:
return None
Expand Down
9 changes: 9 additions & 0 deletions python-client/tira/tira_redirects.py
Original file line number Diff line number Diff line change
Expand Up @@ -1702,6 +1702,15 @@ def mirror_url(url):
return url


def mirror_urls_for_run_output(task, team, dataset, run_id):
system = RUN_ID_TO_SYSTEM.get(run_id, None)
ret = STATIC_REDIRECTS.get(task, {}).get(team, {}).get(system, {}).get(dataset)
if ret is None:
return []
else:
return ret["urls"]


def redirects(approach=None, dataset=None, url=None):
default_ret = {"urls": [url]}
if url is not None:
Expand Down

0 comments on commit fc9d6ea

Please sign in to comment.