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

Version 1.3 (for PBPK Model Library Release 11.3.1) #23

Merged
merged 6 commits into from
Jan 17, 2025
Merged
Show file tree
Hide file tree
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
43 changes: 43 additions & 0 deletions .github/scripts/check_urls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import json
import requests

def check_url(url):
try:
response = requests.head(url, allow_redirects=True, timeout=10)
# Consider checking for other successful status codes if relevant
return response.status_code == 200
except requests.RequestException:
return False

def main():
with open('./templates.json', 'r') as file:
try:
data = json.load(file)
except json.JSONDecodeError as e:
print(f"Error decoding JSON: {e}")
exit(1)

# Access the 'Templates' key in the root object
if 'Templates' in data:
templates = data['Templates']
else:
print("JSON does not contain 'Templates'")
exit(1)

if not isinstance(templates, list):
print("'Templates' is not a list")
exit(1)

for item in templates:
# Ensure each item is a dictionary and has a 'Url' key
if isinstance(item, dict) and 'Url' in item:
url = item['Url']
if not check_url(url):
print(f'URL check failed for {url}')
exit(1) # Exit with error if any URL check fails
else:
print(f"Item is not a dictionary or missing 'Url' key: {item}")
exit(1)

if __name__ == "__main__":
main()
28 changes: 28 additions & 0 deletions .github/workflows/check-urls.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Check URLs in JSON

on:
[push, pull_request]

permissions:
contents: read

jobs:
check-urls:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install requests

- name: Check URLs
run: python .github/scripts/check_urls.py
60 changes: 57 additions & 3 deletions templates.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
{
"Version": "1.2",
"Version": "1.3",
"Templates": [
{
"Type": "Compound",
"Name": "7E3",
"Url": "https://raw.githubusercontent.com/Open-Systems-Pharmacology/7E3-Model/refs/tags/v1.0/7E3.json",
"Qualified": true
},
{
"Type": "Compound",
"Name": "Alfentanil",
Expand All @@ -25,6 +31,18 @@
"Url": "https://raw.githubusercontent.com/Open-Systems-Pharmacology/Atazanavir-Model/v1.2/Atazanavir-Model.json",
"Qualified": true
},
{
"Type": "Compound",
"Name": "BAY794620",
"Url": "https://raw.githubusercontent.com/Open-Systems-Pharmacology/BAY794620-Model/v1.0/BAY794620.json",
"Qualified": true
},
{
"Type": "Compound",
"Name": "CDA1",
"Url": "https://raw.githubusercontent.com/Open-Systems-Pharmacology/CDA1-Model/v1.0/CDA1.json",
"Qualified": true
},
{
"Type": "Compound",
"Name": "Carbamazepine",
Expand All @@ -49,6 +67,12 @@
"Url": "https://raw.githubusercontent.com/Open-Systems-Pharmacology/Dapagliflozin-Model/v1.3/Dapagliflozin-Model.json",
"Qualified": true
},
{
"Type": "Compound",
"Name": "Digoxin",
"Url": "https://raw.githubusercontent.com/Open-Systems-Pharmacology/Digoxin-Model/v2.0/Digoxin-Model.json",
"Qualified": true
},
{
"Type": "Compound",
"Name": "Efavirenz",
Expand Down Expand Up @@ -85,12 +109,30 @@
"Url": "https://raw.githubusercontent.com/Open-Systems-Pharmacology/Fluvoxamine-Model/v1.2/Fluvoxamine-Model.json",
"Qualified": true
},
{
"Type": "Compound",
"Name": "Inulin",
"Url": "https://raw.githubusercontent.com/Open-Systems-Pharmacology/Inulin-Model/v1.0/Inulin.json",
"Qualified": true
},
{
"Type": "Compound",
"Name": "Itraconazole",
"Url": "https://raw.githubusercontent.com/Open-Systems-Pharmacology/Itraconazole-Model/v1.3/Itraconazole-Model.json",
"Qualified": true
},
{
"Type": "Compound",
"Name": "MEDI524",
"Url": "https://raw.githubusercontent.com/Open-Systems-Pharmacology/MEDI524-Model/v1.0/MEDI524.json",
"Qualified": true
},
{
"Type": "Compound",
"Name": "MEDI524YTE",
"Url": "https://raw.githubusercontent.com/Open-Systems-Pharmacology/MEDI524YTE-Model/v1.0/MEDI524YTE.json",
"Qualified": true
},
{
"Type": "Compound",
"Name": "Hydroxy-Itraconazole",
Expand Down Expand Up @@ -166,7 +208,7 @@
{
"Type": "Compound",
"Name": "Rifampicin",
"Url": "https://raw.githubusercontent.com/Open-Systems-Pharmacology/Rifampicin-Model/v1.2/Rifampicin-Model.json",
"Url": "https://raw.githubusercontent.com/Open-Systems-Pharmacology/Rifampicin-Model/v1.3/Rifampicin-Model.json",
"Qualified": true
},
{
Expand All @@ -187,6 +229,12 @@
"Url": "https://raw.githubusercontent.com/Open-Systems-Pharmacology/Sufentanil-Model/v1.2/Sufentanil.json",
"Qualified": true
},
{
"Type": "Compound",
"Name": "Tefibazumab",
"Url": "https://raw.githubusercontent.com/Open-Systems-Pharmacology/Tefibazumab-Model/v1.0/Tefibazumab.json",
"Qualified": true
},
{
"Type": "Compound",
"Name": "Tizanidine",
Expand All @@ -208,7 +256,13 @@
{
"Type": "Compound",
"Name": "Verapamil",
"Url": "https://raw.githubusercontent.com/Open-Systems-Pharmacology/Verapamil-Model/v1.2/Verapamil-Model.json",
"Url": "https://raw.githubusercontent.com/Open-Systems-Pharmacology/Verapamil-Model/v2.0/Verapamil-Model.json",
"Qualified": true
},
{
"Type": "Compound",
"Name": "dAb2",
"Url": "https://raw.githubusercontent.com/Open-Systems-Pharmacology/dAb2-Model/v1.0/dAb2.json",
"Qualified": true
}
]
Expand Down
Loading