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

utils.py with function to get repositories for given hpc #119

Merged
merged 1 commit into from
Jun 17, 2024
Merged
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
21 changes: 21 additions & 0 deletions tools/utils.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import urllib.request, json

CYBERGIS_COMPUTE_SERVER='https://cgjobsup.cigi.illinois.edu/v2/git'

def get_model_repos_for_hpc(hpc_name:str) -> list[str]:
git_repos = []
with urllib.request.urlopen(CYBERGIS_COMPUTE_SERVER) as url:
data = json.load(url)
print(len(data['git']))
for model, value in data['git'].items():
if hpc_name in value['supported_hpc']:
git_repos.append(value["repository"])
pass
pass
pass
return git_repos

if __name__ == '__main__':
repos = get_model_repos_for_hpc(hpc_name='anvil_community')
for r in repos:
print(r)
Loading