Skip to content
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

Retrieving curation labels from figurl #217

Open
khl02007 opened this issue Mar 24, 2023 · 1 comment
Open

Retrieving curation labels from figurl #217

khl02007 opened this issue Mar 24, 2023 · 1 comment

Comments

@khl02007
Copy link
Contributor

url = '...'

# from chatGPT
import urllib.parse
import json

parsed_url = urllib.parse.urlparse(url)

query_dict = urllib.parse.parse_qs(parsed_url.query)
v = query_dict['v'][0]
d = query_dict['d'][0]
label = query_dict['label'][0]
zone = query_dict['zone'][0]

s_str = query_dict['s'][0]
s_dict = json.loads(s_str)

initial_sorting_curation = s_dict['initialSortingCuration']
sorting_curation = s_dict['sortingCuration']

# env var for the private gh repo containing curation.json
import os

os.environ['SORTING_CURATIONS_REPO'] = '...'

# replace the gh repo with local path
local_path = sorting_curation.replace('gh://...', os.environ['SORTING_CURATIONS_REPO'])

# open
import json

with open(local_path, 'r') as f:
    data = json.load(f)
@magland
Copy link
Owner

magland commented Mar 24, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants