Skip to content

Commit ecf2af8

Browse files
committed
starting Python package for test suite code
1 parent 20f616e commit ecf2af8

19 files changed

+600
-13
lines changed

.flake8

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[flake8]
2+
max-line-length = 150
3+
exclude =
4+
tests/*
5+
docs/*

.github/workflows/ci.yml

+197
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,197 @@
1+
name: Continuous integration
2+
3+
on:
4+
- push
5+
6+
jobs:
7+
getVersionNumber:
8+
name: Get version number
9+
if: startsWith(github.ref, 'refs/tags/')
10+
runs-on: ubuntu-latest
11+
outputs:
12+
version: ${{ steps.get-version-number.outputs.version }}
13+
steps:
14+
- id: get-version-number
15+
name: Get version number
16+
env:
17+
TAG: ${{ github.ref }}
18+
run: |
19+
version="${TAG/refs\/tags\//}"
20+
echo "::set-output name=version::$version"
21+
22+
build:
23+
name: Lint, test, and compile documentation
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: Checkout repository
27+
uses: actions/checkout@v2
28+
with:
29+
fetch-depth: 1
30+
31+
- name: Install Python
32+
uses: actions/setup-python@v2
33+
with:
34+
python-version: '3.7'
35+
36+
- name: Setup pip cache
37+
uses: actions/cache@v2
38+
with:
39+
path: /opt/hostedtoolcache/Python
40+
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements.optional.txt') }}
41+
restore-keys: |
42+
${{ runner.os }}-pip-
43+
44+
- name: Install pip and setuptools
45+
run: |
46+
python -m pip install --upgrade pip
47+
python -m pip install --upgrade setuptools
48+
49+
# install package
50+
- name: Install the package
51+
run: python -m pip install .[all]
52+
53+
# lint
54+
- name: Install flake8
55+
run: python -m pip install flake8
56+
57+
- name: Lint the package
58+
run: python -m flake8
59+
60+
# test and upload coverage report to Codecov
61+
- name: Install pytest
62+
run: python -m pip install pytest pytest-cov
63+
64+
- name: Install the requirements for the tests
65+
run: python -m pip install .[tests]
66+
67+
- name: Run the tests
68+
run: python -m pytest tests/ --cov=./biosimulators_test_suite --cov-report=xml
69+
70+
- name: Upload the coverage report to Codecov
71+
uses: codecov/[email protected]
72+
with:
73+
token: ${{ secrets.CODECOV_TOKEN }}
74+
flags: unittests
75+
file: ./coverage.xml
76+
77+
# compile documentation
78+
- name: Install the requirements for compiling the documentation
79+
run: python -m pip install -r docs-src/requirements.txt
80+
81+
- name: Compile the documentation
82+
run: |
83+
sphinx-apidoc . setup.py --output-dir docs-src/source --force --module-first --no-toc
84+
mkdir -p docs-src/_static
85+
sphinx-build docs-src docs
86+
87+
release:
88+
name: Release a new version
89+
needs: [getVersionNumber, build]
90+
runs-on: ubuntu-latest
91+
outputs:
92+
docsChanged: ${{ steps.commit-docs.outputs.docsChanged }}
93+
steps:
94+
- name: Checkout code
95+
uses: actions/checkout@v2
96+
with:
97+
fetch-depth: 1
98+
ref: dev
99+
100+
- name: Install Python
101+
uses: actions/setup-python@v2
102+
with:
103+
python-version: '3.7'
104+
105+
- name: Setup pip cache
106+
uses: actions/cache@v2
107+
with:
108+
path: /opt/hostedtoolcache/Python
109+
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements.optional.txt') }}
110+
restore-keys: |
111+
${{ runner.os }}-pip-
112+
113+
- name: Install pip and setuptools
114+
run: |
115+
python -m pip install --upgrade pip
116+
python -m pip install --upgrade setuptools
117+
118+
# install package
119+
- name: Install the package
120+
run: python -m pip install .[all]
121+
122+
# compile and push documentation
123+
- name: Install the requirements for compiling the documentation
124+
run: python -m pip install -r docs-src/requirements.txt
125+
126+
- name: Compile the documentation
127+
run: |
128+
sphinx-apidoc . setup.py --output-dir docs-src/source --force --module-first --no-toc
129+
mkdir -p docs-src/_static
130+
sphinx-build docs-src docs
131+
132+
- id: commit-docs
133+
name: Commit the compiled documentation
134+
run: |
135+
git config --local user.email "[email protected]"
136+
git config --local user.name "biosimulatorsdaemon"
137+
git config pull.rebase false
138+
git stash
139+
git pull
140+
git stash pop
141+
git add docs
142+
set +e
143+
git commit -m "Updating compiled documentation"
144+
if [[ $? = 0 ]]; then
145+
docsChanged=1
146+
else
147+
docsChanged=0
148+
fi
149+
echo "::set-output name=docsChanged::$docsChanged"
150+
151+
- name: Push the compiled documentation
152+
if: steps.commit-docs.outputs.docsChanged == '1'
153+
uses: ad-m/github-push-action@master
154+
with:
155+
github_token: ${{ secrets.GITHUB_TOKEN }}
156+
branch: dev
157+
158+
# Create GitHub release
159+
- name: Create GitHub release
160+
uses: actions/create-release@v1
161+
env:
162+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
163+
with:
164+
tag_name: ${{ needs.getVersionNumber.outputs.version }}
165+
release_name: Release ${{ needs.getVersionNumber.outputs.version }}
166+
167+
# Create PyPI release
168+
- name: Install pandoc
169+
run: |
170+
sudo apt-get update -y
171+
sudo apt-get install -y --no-install-recommends wget
172+
173+
wget https://github.com/jgm/pandoc/releases -O /tmp/pandocVersions.html
174+
urlPart=`grep "\.deb" /tmp/pandocVersions.html | head -n 1 | cut -d'/' -f2-7 | cut -d'"' -f1`
175+
wget "https://github.com/$urlPart" -O /tmp/pandoc.deb
176+
sudo dpkg -i /tmp/pandoc.deb
177+
rm /tmp/pandocVersions.html
178+
rm /tmp/pandoc.deb
179+
180+
- name: Convert README to .rst format
181+
run: pandoc --from=gfm --output=README.rst --to=rst README.md
182+
183+
- name: Install twine
184+
run: |
185+
python -m pip install wheel twine
186+
187+
- name: Create packages to upload to PyPI
188+
run: |
189+
python setup.py sdist
190+
python setup.py bdist_wheel
191+
192+
- name: Upload packages to PyPI
193+
env:
194+
TWINE_USERNAME: __token__
195+
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
196+
run: |
197+
twine upload dist/*

.gitignore

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# compiled Python files
2+
*.egg-info/
3+
__pycache__/
4+
*.pyc
5+
dist/
6+
build/
7+
8+
# coverage files
9+
htmlcov/
10+
.coverage
11+
coverage.xml
12+
13+
# compiled documentation
14+
README.rst
15+
docs/objects.inv
16+
docs/.buildinfo
17+
docs/.doctrees/
18+
docs/_raw_sources/
19+
docs/_sources/

CONTRIBUTING.md

+36-7
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,47 @@
1-
# Contributing to the BioSimulations COMBINE archive test suite
1+
# Contributing to the BioSimulators test suite
22

3-
We enthusiastically welcome contributions to the BioSimulations COMBINE archive test suite!
3+
We enthusiastically welcome contributions to the BioSimulators test suite!
44

55
## Coordinating contributions
66

77
Before getting started, please contact the lead developers at [[email protected]](mailto:[email protected]) to coordinate your planned contributions with other ongoing efforts. Please also use GitHub issues to announce your plans to the community so that other developers can provide input into your plans and coordinate their own work. As the development community grows, we will institute additional infrastructure as needed such as a leadership committee and regular online meetings.
88

99
## Repository organization
1010

11-
* `README.md`: Overview of the test suite
12-
* `biosimulators_test_suite/`: collection of COMBINE/OMEX archives (`.omex` files) and metadata about each archive (one JSON file per archive)
13-
* `LICENSE`: License
14-
* `CONTRIBUTING.md`: Guide to contributing to the test suite (this document)
15-
* `CODE_OF_CONDUCT.md`: Code of conduct for developers
11+
This repository follows standard Python conventions:
12+
13+
* `README.md`: Overview of this repository
14+
* `biosimulators_test_suite/`: Source code for this package
15+
* `examples`: Example modeling projects that the source code uses to test biosimulation software tools
16+
* `examples-ouputs`: Example outputs (reports and plots) of executing the example modeling projects
17+
* `tests/`: Unit tests for the code for this package
18+
* `setup.py`: pip installation script for this package
19+
* `setup.cfg`: Configuration for the pip installation script
20+
* `requirements.txt`: Dependencies of this package
21+
* `requirements.optional.txt`: Optional dependencies of this package
22+
* `MANIFEST.in`: List of files to include when the BioSimulators test suite is packaged for distribution through PyPI
23+
* `LICENSE`: License for the sofware of this package
24+
* `LICENSE-DATA`: License for the example modeling projects in this package
25+
* `CONTRIBUTING.md`: Guide to contributing to this package (this document)
26+
* `CODE_OF_CONDUCT.md`: Code of conduct for developers of this package
27+
28+
## Coding convention
29+
30+
The code in this repository follows standard Python style conventions:
31+
32+
* Class names: `UpperCamelCase`
33+
* Function names: `lower_snake_case`
34+
* Variable names: `lower_snake_case`
35+
36+
## Documentation convention
37+
38+
The code in the BioSimulators test suite is documented using [reStructuredText](https://www.sphinx-doc.org/en/master/usage/restructuredtext/index.html) and the [napoleon Sphinx plugin](https://www.sphinx-doc.org/en/master/usage/extensions/napoleon.html). The documentation can be compiled with [Sphinx](https://www.sphinx-doc.org/) by running the following commands:
39+
40+
```
41+
python -m pip install -r docs-src/requirements.txt
42+
sphinx-apidoc . setup.py --output-dir docs-src/source --force --module-first --no-toc
43+
sphinx-build docs-src docs
44+
```
1645

1746
## Submitting changes
1847

MANIFEST.in

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# description
2+
include README.rst
3+
4+
# license
5+
include LICENSE
6+
7+
# requirements
8+
include requirements.txt
9+
include requirements.optional.txt

README.md

+24-6
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,46 @@
1+
[![Latest release](https://img.shields.io/github/v/release/biosimulators/Biosimulators_test_suite)](https://github.com/biosimulators/Biosimulators_test_suite/releases)
2+
[![PyPI](https://img.shields.io/pypi/v/Biosimulators-test-suite)](https://pypi.org/project/Biosimulators-test-suite/)
3+
[![CI status](https://github.com/biosimulators/Biosimulators_test_suite/workflows/Continuous%20integration/badge.svg)](https://github.com/biosimulators/Biosimulators_test_suite/actions?query=workflow%3A%22Continuous+integration%22)
4+
[![Test coverage](https://codecov.io/gh/biosimulators/Biosimulators_test_suite/branch/dev/graph/badge.svg)](https://codecov.io/gh/biosimulators/Biosimulators_test_suite)
5+
16
# BioSimulators test suite
27

3-
This package contains two related resources:
8+
The BioSimulators test suite is a tool for validating that biosimulation software tools implement the [BioSimulators standards for biosimulation tools](https://biosimulators.org/standards).
9+
10+
The test suite is composed of two parts:
11+
12+
* A collection of example modeling projects. Each project is represented by a single [COMBINE/OMEX archive](https://combinearchive.org/) that contains one or more simulation experiments described using the [Simulation Experiment Description Markup Language (SED-ML)](https://sed-ml.org) and one or more models described using a format such as the [BioNetGen Language (BNGL)](https://bionetgen.org) or the [Systems Biology Markup Language (SBML)](http://sbml.org).
13+
14+
* Software for checking that biosimulation tools execute these projects according to the BioSimulators standards.
15+
16+
* Simulation tools support the [BioSimulators standard command-line arguments](https://biosimulators.org/standards/simulator-interfaces).
17+
* Simulation tools support the [BioSimulators conventions for Docker images](https://biosimulators.org/standards/simulator-images).
18+
* Simulation tools follow the [BioSimulators conventions for executing simulations described by SED-ML files in COMBINE/OMEX archives](https://biosimulators.org/standards/simulation-experiments).
19+
* Simulation tools support the [BioSimulators conventions for the outputs of SED-ML files in COMBINE/OMEX archives](https://biosimulators.org/standards/simulation-reports).
420

5-
* **Collection of example [COMBINE/OMEX](http://co.mbine.org/standards/omex) archives**: This collection is a reference for the community. The collection is also the test suite that [BioSimulators](https://biosimulators.org) uses to validate the capabilities of simulation tools.
6-
* **Software for validating simulation tools**: This package also contains software for testing that simulation tools are compatible with the [BioSimulators standards for simulation software tools](https://biosimulators.org).
721

822
## Contents
23+
* [Installation instructions, tutorial, and API documentation](#installation-instructions,-tutorial,-and-API-documentation)
924
* [License](#license)
1025
* [Development team](#development-team)
1126
* [Contributing to the test suite](#contributing-to-the-test-suite)
1227
* [Acknowledgements](#acknowledgements)
1328
* [Questions and comments](#questions-and-comments)
1429

30+
## Installation instructions, tutorial, and API documentation
31+
Installation instructions, tutorial, and API documentation are available [here](https://biosimulators.github.io/Biosimulators_test_suite/).
32+
1533
## License
16-
The COMBINE/OMEX archives in this package are released under the [Creative Commons CC0 license](LICENSE-DATA). The software in this package is released under the [MIT License](LICENSE).
34+
The software in this package is released under the [MIT License](LICENSE). The modeling projects in this package are released under the [Creative Commons 1.0 Universal (CC0) license](LICENSE-DATA).
1735

1836
## Development team
19-
This package was developed by the [Karr Lab](https://www.karrlab.org) at the Icahn School of Medicine at Mount Sinai in New York and the [Center for Reproducible Biomedical Modeling](http://reproduciblebiomodels.org).
37+
This package was developed by the [Karr Lab](https://www.karrlab.org) at the Icahn School of Medicine at Mount Sinai in New York, the [https://health.uconn.edu/cell-analysis-modeling/](https://health.uconn.edu/cell-analysis-modeling/) at the University of Connecticut, and the [Center for Reproducible Biomedical Modeling](http://reproduciblebiomodels.org).
2038

2139
## Contributing to the test suite
2240
We enthusiastically welcome contributions to the test suite! Please see the [guide to contributing](CONTRIBUTING.md) and the [developer's code of conduct](CODE_OF_CONDUCT.md).
2341

2442
## Acknowledgements
25-
This work was supported by National Institutes of Health awards P41EB023912 and R35GM119771 and the Icahn Institute for Data Science and Genomic Technology.
43+
This work was supported by National Institutes of Health award P41EB023912.
2644

2745
## Questions and comments
2846
Please contact the [BioSimulators Team](mailto:[email protected]) with any questions or comments.

docs-src/about.rst

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
About the BioSimulators test suite
2+
==================================
3+
4+
License
5+
-------
6+
The software for the test suite is released under the `MIT License <https://github.com/biosimulators/Biosimulators_test_suite/blob/dev/LICENSE>`_. The example modeling projects in the test suite are released under the `Creative Commons 1.0 Universal (CCO) License <https://github.com/biosimulators/Biosimulators_test_suite/blob/dev/LICENSE-DATA>`_.
7+
8+
Development team
9+
----------------
10+
This package was developed by the `Karr Lab <https://www.karrlab.org>`_ at the Icahn School of Medicine at Mount Sinai, the `Center for Cell Analysis & Modeling <https://health.uconn.edu/cell-analysis-modeling/>`_ at the University of Connecticut, and the `Center for Reproducible Biomedical Modeling <https://reproduciblebiomodels.org/>`_.
11+
12+
Contributing to the BioSimulators test suite
13+
--------------------------------------------
14+
We enthusiastically welcome contributions to the BioSimulators test suite! Please see the `guide to contributing <https://github.com/biosimulators/Biosimulators_test_suite/blob/dev/CONTRIBUTING.md>`_ and the `developer's code of conduct <https://github.com/biosimulators/Biosimulators_test_suite/blob/dev/CODE_OF_CONDUCT.md>`_.
15+
16+
Acknowledgements
17+
----------------
18+
This work was supported by National Institutes of Health award P41EB023912.
19+
20+
Questions and comments
21+
-------------------------
22+
Please contact the `BioSimulators Team <mailto:[email protected]>`_ with any questions or comments.

0 commit comments

Comments
 (0)