Skip to content

Commit

Permalink
inital repository setup
Browse files Browse the repository at this point in the history
  • Loading branch information
zmbc committed Jul 8, 2024
0 parents commit a87891c
Show file tree
Hide file tree
Showing 39 changed files with 2,070 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# default owners
* @albrja @hussain-jafari @patricktnast @rmudambi @stevebachmeier
21 changes: 21 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
## Title: Summary, imperative, start upper case, don't end with a period
<!-- Ideally, <=50 chars. 50 chars is here..: -->

### Description
<!-- For use in commit message, wrap at 72 chars. 72 chars is here: -->
- *Category*: <!-- one of bugfix, data artifact, implementation, observers,
post-processing, refactor, revert, test, release, other/misc -->
- *JIRA issue*: https://jira.ihme.washington.edu/browse/MIC-XYZ
- *Research reference*: <!--Link to research documentation for code -->

### Changes and notes
<!--
Change description – why, what, anything unexplained by the above.
Include guidance to reviewers if changes are complex.
-->

### Verification and Testing
<!--
Details on how code was verified. Consider: plots, images, (small) csv files.
-->

105 changes: 105 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
# -----------------------------------------------------------------------------
# - invoked on push, pull_request, or manual trigger
# - test under all supported versions of Python (python_versions.json)
# -----------------------------------------------------------------------------
name: build
on: [push, pull_request, workflow_dispatch]

jobs:
get-python-versions:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install jq
run: sudo apt-get install jq
- name: Get Python versions
id: set-matrix
run: |
echo "MATRIX_RESULT=$(jq -c . python_versions.json)" >> $GITHUB_ENV
outputs:
matrix: ${{ env.MATRIX_RESULT }}
build:
needs: get-python-versions
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ${{ fromJSON(needs.get-python-versions.outputs.matrix) }}
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: get upstream branch name
run: |
if "${{ github.event_name == 'pull_request' }}" ; then
echo "branch_name=${GITHUB_HEAD_REF}" >> $GITHUB_ENV
else
echo "branch_name=${GITHUB_REF_NAME}" >> $GITHUB_ENV
fi
- name: check for upstream vivarium
run: |
if git ls-remote --exit-code --heads https://github.com/ihmeuw/vivarium.git ${branch_name} == "0"; then
echo "upstream_exist=true" >> $GITHUB_ENV
else
echo "upstream_exist=false" >> $GITHUB_ENV
fi
- name: check for upstream vivarium_public_health
run: |
if git ls-remote --exit-code --heads https://github.com/ihmeuw/vivarium_public_health.git ${branch_name} == "0"; then
echo "upstream_exist=true" >> $GITHUB_ENV
else
echo "upstream_exist=false" >> $GITHUB_ENV
fi
- name: check for upstream vivarium_inputs
run: |
if git ls-remote --exit-code --heads https://github.com/ihmeuw/vivarium_inputs.git ${branch_name} == "0"; then
echo "upstream_exist=true" >> $GITHUB_ENV
else
echo "upstream_exist=false" >> $GITHUB_ENV
fi
- name: print environment values
run: |
cat $GITHUB_ENV
- name: Update pip
run: |
python -m pip install --upgrade pip
- name: Retrieve upstream vivarium
if: env.upstream_vivarium_exist == 'true'
run: |
echo "Cloning vivarium upstream branch: ${GITHUB_HEAD_REF}"
git clone --branch=${GITHUB_HEAD_REF} https://github.com/ihmeuw/vivarium.git
pushd vivarium
pip install .
popd
- name: Retrieve upstream vivarium_public_health
if: env.upstream_vivarium_public_health_exist == 'true'
run: |
echo "Cloning vivarium_public_health upstream branch: ${GITHUB_HEAD_REF}"
git clone --branch=${GITHUB_HEAD_REF} https://github.com/ihmeuw/vivarium_public_health.git
pushd vivarium_public_health
pip install .
popd
- name: Retrieve upstream vivarium_inputs
if: env.upstream_vivarium_inputs_exist == 'true'
run: |
echo "Cloning upstream vivarium_inputs branch: ${GITHUB_HEAD_REF}"
git clone --branch=${GITHUB_HEAD_REF} https://github.com/ihmeuw/vivarium_inputs.git
pushd vivarium_inputs
pip install .
popd
- name: Install dependencies
run: |
pip install .[test]
- name: Lint
run: |
pip install black==22.3.0 isort
black . --check -v
isort . --check -v
- name: Test
run: |
pytest ./tests
32 changes: 32 additions & 0 deletions .github/workflows/update_readme.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# -----------------------------------------------------------------------------
# - invoked on push to any branch
# -----------------------------------------------------------------------------
name: update README
on: push

jobs:
update-readme:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.11
- name: Update README
run: |
pip install packaging
python update_readme.py
- name: Commit and push changes
run: |
git config --local user.email "[email protected]"
git config --local user.name "github-actions"
git diff --quiet && git diff --staged --quiet || (
git add README.rst
git commit -am "update README with supported Python versions"
git pull --rebase origin ${{ github.ref_name }}
git push origin ${{ github.ref_name }}
)
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
130 changes: 130 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# Pycharm project settings
.idea/

# Version file
src/*/_version.py
14 changes: 14 additions & 0 deletions .zenodo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"license": "BSD-3-Clause",
"title": "ihmeuw/vivarium_sodium_reduction: Archival release",
"upload_type": "software",
"creators": [
// {
// "orcid": "0000-0000-0000-0000",
// "affiliation": "Institute for Health Metrics and Evaluation",
// "name": "TODO: Add authors names, affiliation, and orcid (if applicable) to `creators` array"
// }
],
"access_right": "open",
"description": "<p>TODO: add description (e.g., Archival release of simulation software.)</p>"
}
3 changes: 3 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**v0.0.0 - mm/dd/yy**

- Initial release
29 changes: 29 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
BSD 3-Clause License

Copyright 2022 Institute for Health Metrics and Evaluation
All rights reserved

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
5 changes: 5 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
include LICENSE
include README.rst

recursive-include src/vivarium_sodium_reduction *.py *.yaml *.ipynb
recursive-include tests *.py *txt *.yaml
Loading

0 comments on commit a87891c

Please sign in to comment.