Skip to content

Commit

Permalink
Merge branch 'main' into feature_cases
Browse files Browse the repository at this point in the history
  • Loading branch information
dweindl authored Jun 29, 2024
2 parents ea4e807 + e2e1528 commit 9c2992c
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 39 deletions.
3 changes: 2 additions & 1 deletion .ci_pip_reqs.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
pytest
flake8
https://github.com/petab-dev/libpetab-python/archive/develop.zip
git+https://github.com/PEtab-dev/libpetab-python@develop
sympy>=1.12.1
3 changes: 2 additions & 1 deletion .github/workflows/ci_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel
pip install -r .ci_pip_reqs.txt
pip install -e .
pip uninstall -y petab
pip install -r .ci_pip_reqs.txt
- name: Run tests
run: |
python -m flake8 \
Expand Down
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
include petabtests/conversion.xml
recursive-include petabtests/cases *
recursive-exclude **/__pycache__ *
exclude cases
20 changes: 15 additions & 5 deletions petabtests/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
import petab
import yaml
from petab.C import * # noqa: F403

from petab.v1.lint import lint_problem as lint_problem_v1
from petab.v2.lint import lint_problem as lint_problem_v2
from .C import * # noqa: F403

__all__ = [
Expand Down Expand Up @@ -180,13 +181,22 @@ def write_problem(

# write yaml
yaml_file = problem_yaml_name(test_id)
with open(os.path.join(dir_, yaml_file), 'w') as outfile:
yaml_path = os.path.join(dir_, yaml_file)
with open(yaml_path, 'w') as outfile:
yaml.dump(config, outfile, default_flow_style=False)

# validate written PEtab files
problem = petab.Problem.from_yaml(os.path.join(dir_, yaml_file))
if petab.lint_problem(problem):
raise RuntimeError("Invalid PEtab problem, see messages above.")
if format_version == 1:
# PEtab v1
problem = petab.Problem.from_yaml(yaml_path)
if lint_problem_v1(problem):
raise RuntimeError("Invalid PEtab problem, see messages above.")
else:
# v2
validation_result = lint_problem_v2(yaml_path)
if validation_result:
print(validation_result)
raise RuntimeError("Invalid PEtab problem, see messages above.")


def write_solution(
Expand Down
38 changes: 38 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,41 @@
[build-system]
requires = ["setuptools", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "petabtests"
dynamic = ["version"]
description = "PEtab testsuite library"
readme = "README.md"
authors = [
{ name = "Daniel Weindl", email = "[email protected]" },
{ name = "Yannik Schaelte", email = "[email protected]" },
]
maintainers = [
{ name = "Daniel Weindl", email = "[email protected]" },
]
requires-python = ">=3.10"
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]
keywords = ["PEtab", "testsuite"]
dependencies = [
"numpy>=1.22",
"pandas>=2.0",
"petab>=0.1.4",
"pysb>=1.16.0",
"simplesbml",
]

[project.urls]
homepage = "https://github.com/PEtab-dev/petab_test_suite"

[project.scripts]
petabtests_create = "petabtests.core:create"
petabtests_clear = "petabtests.core:clear"
32 changes: 0 additions & 32 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,41 +18,9 @@ def read(fname):
exec(read(path.join(here, 'petabtests', 'version.py')))

setup(
name='petabtests',
version=__version__, # noqa: F821
description='PEtab testsuite library',
long_description=long_description,
long_description_content_type='text/markdown',
url='https://github.com/PEtab-dev/petab_test_suite',
author='PEtab-dev',
author_email='[email protected]',
maintainer='PEtab-dev',
maintainer_email='[email protected]',
# author_email='',
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
],
keywords='PEtab testsuite',
packages=find_namespace_packages(),
install_requires=[
'numpy',
'pandas',
'petab>=0.1.4',
'pysb',
'simplesbml',
],
python_requires='>=3.10',
entry_points={
'console_scripts': [
'petabtests_create = petabtests.core:create',
'petabtests_clear = petabtests.core:clear',
]
},
include_package_data=True,
)

0 comments on commit 9c2992c

Please sign in to comment.