Add miiv_demo #46
This file contains hidden or 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
| name: CI | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| jobs: | |
| integration-tests: | |
| name: Unit tests - ${{ matrix.PYTHON_VERSION }} | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| PYTHON_VERSION: ["3.12"] | |
| defaults: | |
| run: | |
| # see https://github.com/conda-incubator/setup-miniconda/#important | |
| shell: bash -l {0} | |
| steps: | |
| - uses: actions/checkout@v3 | |
| with: | |
| lfs: true | |
| - name: Set up micromamba | |
| uses: mamba-org/setup-micromamba@29d0a406a44cd30f78c79aa44683acbf49ebc6b4 | |
| with: | |
| micromamba-version: 2.0.8-0 | |
| cache-downloads: true | |
| environment-file: environment.yml | |
| - name: Install repository | |
| run: python -m pip install --no-build-isolation --no-deps --disable-pip-version-check -e . | |
| - name: install icd-mappings | |
| run: pip install icd-mappings | |
| - name: Move features.parquet out of the way | |
| run: | | |
| mv tests/testdata/eicu_demo/features.parquet tests/testdata/eicu_demo/old_features.parquet | |
| mv tests/testdata/mimic_demo-carevue/features.parquet tests/testdata/mimic_demo-carevue/old_features.parquet | |
| mv tests/testdata/miiv_demo/features.parquet tests/testdata/miiv_demo/old_features.parquet | |
| - name: feature engineering for eicu_demo | |
| run: | | |
| python icu_features/icd_codes.py --data_dir "tests/testdata" --dataset "eicu_demo" | |
| python icu_features/feature_engineering.py --dataset "eicu_demo" --data_dir "tests/testdata" | |
| - name: feature engineering for mimic_demo | |
| run: | | |
| python icu_features/split_datasets.py --data_dir "tests/testdata" | |
| python icu_features/icd_codes.py --data_dir "tests/testdata" --dataset "mimic_demo-carevue" | |
| python icu_features/feature_engineering.py --dataset "mimic_demo-carevue" --data_dir "tests/testdata" | |
| - name: feature engineering for miiv_demo | |
| run: | | |
| python icu_features/icd_codes.py --data_dir "tests/testdata" --dataset "miiv_demo" | |
| python icu_features/feature_engineering.py --dataset "miiv_demo" --data_dir "tests/testdata" | |
| - name: compare new to old features.parquet | |
| run: | | |
| python -c "import pyarrow.parquet as pq;old = pq.read_table('tests/testdata/eicu_demo/old_features.parquet');new = pq.read_table('tests/testdata/eicu_demo/features.parquet');assert old.equals(new)" | |
| python -c "import pyarrow.parquet as pq;old = pq.read_table('tests/testdata/mimic_demo-carevue/old_features.parquet');new = pq.read_table('tests/testdata/mimic_demo-carevue/features.parquet');assert old.equals(new)" | |
| python -c "import pyarrow.parquet as pq;old = pq.read_table('tests/testdata/miiv_demo/old_features.parquet');new = pq.read_table('tests/testdata/miiv_demo/features.parquet');assert old.equals(new)" | |
| - name: Pytest | |
| run: pytest tests | |
| pre-commit-checks: | |
| name: "Linux - pre-commit checks - Python 3.12" | |
| timeout-minutes: 30 | |
| runs-on: ubuntu-latest | |
| env: | |
| PRE_COMMIT_USE_MICROMAMBA: 1 | |
| steps: | |
| - name: Checkout branch | |
| uses: actions/checkout@v3.5.2 | |
| - name: Set up micromamba | |
| uses: mamba-org/setup-micromamba@d05808540d968a55ca33c798e0661fb98f533c73 | |
| with: | |
| micromamba-version: 1.5.10-0 | |
| - name: Add micromamba to GITHUB_PATH | |
| run: echo "${HOME}/micromamba-bin" >> "$GITHUB_PATH" | |
| - name: Install Python 3.12 | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: "3.12" | |
| - name: Run pre-commit checks | |
| uses: pre-commit/action@v3.0.0 |