-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
9 changed files
with
190 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
adjectives.txt | ||
animals.yaml | ||
collection.json | ||
do_upload.sh | ||
do_workflow.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# BioImage.IO Scripts | ||
|
||
Scripts for managing the micro-sam models in the BioImage.IO collection: https://github.com/bioimage-io/collection | ||
|
||
- export_models.py: to create the modelzoo format. | ||
- stage_models.py: to call the stage workflow for uploading new versions. | ||
- publish_models.py: to call the publish workflow for already staged versions. | ||
- get_dois.py: to get the zenodo DOI's for already published versions. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
|
||
import requests | ||
from models import MODEL_TO_ID | ||
|
||
URL_BASE = "https://uk1s3.embassy.ebi.ac.uk/public-datasets/bioimage.io/%s/versions.json" | ||
|
||
|
||
def get_zenodo_url(model_name, model_id): | ||
|
||
url = URL_BASE % model_id | ||
response = requests.get(url) | ||
|
||
if response.status_code == 200: | ||
data = response.json() | ||
else: | ||
print("Failed to retrieve data:", response.status_code) | ||
|
||
doi = data["published"]["1"]["doi"] | ||
doi = f"https://doi.org/{doi}" | ||
|
||
print(model_name, ":") | ||
print(model_id) | ||
print(doi) | ||
print() | ||
|
||
|
||
for model_name, model_id in MODEL_TO_ID.items(): | ||
get_zenodo_url(model_name, model_id) |
Oops, something went wrong.