-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Consolidate scripts and python package
* some functionality from scripts/ would be useful inside the library * some functionality from the library was replicated in scripts/ -> consolidate, turn separate scripts into entrypoints * Reduce number of package configuration files
- Loading branch information
Showing
12 changed files
with
125 additions
and
157 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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,23 @@ | ||
from pathlib import Path | ||
import os | ||
import sys | ||
from . import MODELS, get_problem_yaml_path | ||
|
||
def main(): | ||
num_failures = 0 | ||
|
||
for petab_problem_id in MODELS: | ||
print(petab_problem_id) | ||
petab_yaml = get_problem_yaml_path(petab_problem_id) | ||
ret = os.system(f"petablint -v {petab_yaml}") | ||
print('='*100) # just for output readability | ||
|
||
if ret: | ||
num_failures += 1 | ||
|
||
num_passed = len(MODELS) - num_failures | ||
print(f'Result: {Path(__file__).stem}') | ||
print(f"{num_passed} out of {len(MODELS)} passed.") | ||
print(f"{num_failures} out of {len(MODELS)} failed.") | ||
# Fail unless all models passed | ||
sys.exit(num_failures) |
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,48 @@ | ||
#!/usr/bin/env python3 | ||
|
||
from pathlib import Path | ||
import sys | ||
from .overview import get_reference_uris | ||
from . import MODELS, get_problem | ||
|
||
def main(): | ||
num_failures = 0 | ||
|
||
for petab_problem_id in MODELS: | ||
petab_problem = get_problem(petab_problem_id) | ||
|
||
model_id = petab_problem.sbml_model.getId() | ||
model_name = petab_problem.sbml_model.getName() | ||
reference_uris = get_reference_uris(sbml_model=petab_problem.sbml_model) | ||
|
||
errors = [] | ||
|
||
if model_id != petab_problem_id: | ||
errors.append( | ||
'Please change the model ID to match the problem ID.' | ||
) | ||
|
||
if model_name != petab_problem_id: | ||
errors.append( | ||
'Please change the model name to match the problem ID.' | ||
) | ||
|
||
if not reference_uris: | ||
errors.append( | ||
'Please add relevant references (e.g. the paper) to the model.' | ||
) | ||
|
||
errors = ['\t' + error for error in errors] | ||
|
||
print(petab_problem_id) | ||
if errors: | ||
print('\n'.join(errors)) | ||
num_failures += 1 | ||
print('='*100) # just for output readability | ||
|
||
num_passed = len(MODELS) - num_failures | ||
print(f'Result: {Path(__file__).stem}') | ||
print(f"{num_passed} out of {len(MODELS)} passed.") | ||
print(f"{num_failures} out of {len(MODELS)} failed.") | ||
# Fail unless all models passed | ||
sys.exit(num_failures) |
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.