diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml new file mode 100644 index 0000000000..d8ca6d7bec --- /dev/null +++ b/.github/workflows/build_wheels.yml @@ -0,0 +1,35 @@ +name: Build wheels + +on: [pull_request, release] + +jobs: + + build_sdist: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - run: pipx run build --sdist + + - uses: actions/upload-artifact@v4 + with: + name: sdist + path: dist/*.tar.gz + + + build_wheels: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, windows_latest] + + steps: + - uses: actions/checkout@v4 + + - uses: pypa/cibuildwheel@v2.16 + + - uses: actions/upload-artifact@v4 + with: + name: wheels-${{ matrix.os }} + path: ./wheelhouse/*.whl \ No newline at end of file diff --git a/.github/workflows/epidata_main.yml b/.github/workflows/epidata_main.yml index 3cd8fea21b..e8e84dd564 100644 --- a/.github/workflows/epidata_main.yml +++ b/.github/workflows/epidata_main.yml @@ -1,158 +1,158 @@ -name: Epidata-CI +# name: Epidata-CI -on: - schedule: - - cron: "40 1 * * *" - push: - branches: - - 'main' - tags: - - version-* - paths: - - '**/memilio-epidata/**' - - '.github/**' - pull_request: - types: [opened, reopened, synchronize, ready_for_review] - paths: - - '**/memilio-epidata/**' - - '.github/**' - workflow_dispatch: +# on: +# schedule: +# - cron: "40 1 * * *" +# push: +# branches: +# - 'main' +# tags: +# - version-* +# paths: +# - '**/memilio-epidata/**' +# - '.github/**' +# pull_request: +# types: [opened, reopened, synchronize, ready_for_review] +# paths: +# - '**/memilio-epidata/**' +# - '.github/**' +# workflow_dispatch: -jobs: - pre-commit: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - with: - python-version: 3.12 - - uses: pre-commit/action@v3.0.1 +# jobs: +# pre-commit: +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v4 +# - uses: actions/setup-python@v5 +# with: +# python-version: 3.12 +# - uses: pre-commit/action@v3.0.1 - build-py-epidata: - runs-on: ubuntu-latest - container: quay.io/pypa/manylinux_2_28_x86_64 - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/build-py - with: - package: epidata +# build-py-epidata: +# runs-on: ubuntu-latest +# container: quay.io/pypa/manylinux_2_28_x86_64 +# steps: +# - uses: actions/checkout@v4 +# - uses: ./.github/actions/build-py +# with: +# package: epidata - build-py-plot: - if: github.event.pull_request.draft == false - runs-on: ubuntu-latest - container: quay.io/pypa/manylinux_2_28_x86_64 - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/build-py - with: - package: plot +# build-py-plot: +# if: github.event.pull_request.draft == false +# runs-on: ubuntu-latest +# container: quay.io/pypa/manylinux_2_28_x86_64 +# steps: +# - uses: actions/checkout@v4 +# - uses: ./.github/actions/build-py +# with: +# package: plot - test-py-epidata: - needs: build-py-epidata - strategy: - matrix: - version: ["3.8", "3.12"] - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/test-py - with: - version: ${{ matrix.version }} - package: epidata - coverage: ON +# test-py-epidata: +# needs: build-py-epidata +# strategy: +# matrix: +# version: ["3.8", "3.12"] +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v4 +# - uses: ./.github/actions/test-py +# with: +# version: ${{ matrix.version }} +# package: epidata +# coverage: ON - test-py-plot: - if: github.event.pull_request.draft == false - needs: [build-py-plot, build-py-epidata] - strategy: - matrix: - version: ["3.8", "3.12"] - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/test-py - with: - version: ${{ matrix.version }} - package: plot - coverage: ON +# test-py-plot: +# if: github.event.pull_request.draft == false +# needs: [build-py-plot, build-py-epidata] +# strategy: +# matrix: +# version: ["3.8", "3.12"] +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v4 +# - uses: ./.github/actions/test-py +# with: +# version: ${{ matrix.version }} +# package: plot +# coverage: ON - merge-artifacts: - runs-on: ubuntu-latest - strategy: - matrix: - packages: [epidata, plot] - needs: [test-py-plot, test-py-epidata] - steps: - - name: merge epidata reports - uses: actions/upload-artifact/merge@v4 - with: - name: test-py-coverage-reports-${{ matrix.packages }} - pattern: test-py-coverage-reports-${{ matrix.packages }}-* +# merge-artifacts: +# runs-on: ubuntu-latest +# strategy: +# matrix: +# packages: [epidata, plot] +# needs: [test-py-plot, test-py-epidata] +# steps: +# - name: merge epidata reports +# uses: actions/upload-artifact/merge@v4 +# with: +# name: test-py-coverage-reports-${{ matrix.packages }} +# pattern: test-py-coverage-reports-${{ matrix.packages }}-* - test-pylint-epidata: - needs: build-py-epidata - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/test-pylint - with: - package: epidata +# test-pylint-epidata: +# needs: build-py-epidata +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v4 +# - uses: ./.github/actions/test-pylint +# with: +# package: epidata - test-pylint-plot: - needs: build-py-plot - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/test-pylint - with: - package: plot +# test-pylint-plot: +# needs: build-py-plot +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v4 +# - uses: ./.github/actions/test-pylint +# with: +# package: plot - download-data: - needs: build-py-epidata - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v4 - - name: Install dependencies - run: | - sudo apt-get -qq update - sudo apt-get -qq -y install python3-pip gnupg - python -m pip install --upgrade pip - - name: Download Python Wheels - uses: actions/download-artifact@v4 - with: - name: python-wheels-epidata - path: pycode/wheelhouse - - name: Set up Python 3.12 - uses: actions/setup-python@v5 - with: - python-version: 3.12 - - name: Install Python Wheels - run: | - for pkg in `ls pycode/wheelhouse/*cp312*.whl`; do python -m pip install $pkg; done # packages that contain native extensions are version specific - for pkg in `ls pycode/wheelhouse/*py3*.whl`; do python -m pip install $pkg; done # pure python packages are not version specific - - name: Download Data - run: | - mkdir -p data_dl - getcasedata -o data_dl --no-progress-indicators - getpopuldata -o data_dl --no-progress-indicators - getjhdata -o data_dl --no-progress-indicators - getdividata -o data_dl --no-progress-indicators - getcommutermobility -o data_dl --no-progress-indicators - getvaccinationdata -o data_dl --no-progress-indicators - gethospitalizationdata -o data_dl --no-progress-indicators - - name: Upload Data - uses: actions/upload-artifact@v4 - with: - name: data - path: | - data_dl/*.json - data_dl/Germany/*.json - data_dl/Spain/*.json - data_dl/France/*.json - data_dl/Italy*.json - data_dl/SouthKorea/*.json - data_dl/US/*.json - data_dl/China/*.json - retention-days: 1 +# download-data: +# needs: build-py-epidata +# runs-on: ubuntu-latest +# continue-on-error: true +# steps: +# - uses: actions/checkout@v4 +# - name: Install dependencies +# run: | +# sudo apt-get -qq update +# sudo apt-get -qq -y install python3-pip gnupg +# python -m pip install --upgrade pip +# - name: Download Python Wheels +# uses: actions/download-artifact@v4 +# with: +# name: python-wheels-epidata +# path: pycode/wheelhouse +# - name: Set up Python 3.12 +# uses: actions/setup-python@v5 +# with: +# python-version: 3.12 +# - name: Install Python Wheels +# run: | +# for pkg in `ls pycode/wheelhouse/*cp312*.whl`; do python -m pip install $pkg; done # packages that contain native extensions are version specific +# for pkg in `ls pycode/wheelhouse/*py3*.whl`; do python -m pip install $pkg; done # pure python packages are not version specific +# - name: Download Data +# run: | +# mkdir -p data_dl +# getcasedata -o data_dl --no-progress-indicators +# getpopuldata -o data_dl --no-progress-indicators +# getjhdata -o data_dl --no-progress-indicators +# getdividata -o data_dl --no-progress-indicators +# getcommutermobility -o data_dl --no-progress-indicators +# getvaccinationdata -o data_dl --no-progress-indicators +# gethospitalizationdata -o data_dl --no-progress-indicators +# - name: Upload Data +# uses: actions/upload-artifact@v4 +# with: +# name: data +# path: | +# data_dl/*.json +# data_dl/Germany/*.json +# data_dl/Spain/*.json +# data_dl/France/*.json +# data_dl/Italy*.json +# data_dl/SouthKorea/*.json +# data_dl/US/*.json +# data_dl/China/*.json +# retention-days: 1 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b87795d7bd..4bafd6e343 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,355 +1,355 @@ -name: CI +# name: CI -on: - schedule: - - cron: "40 2 * * *" - push: - branches: - - "main" - tags: - - version-* - paths-ignore: - - "**/memilio-epidata/**" - pull_request: - types: [opened, reopened, synchronize, ready_for_review] - paths-ignore: - - "**/memilio-epidata/**" - workflow_dispatch: +# on: +# schedule: +# - cron: "40 2 * * *" +# push: +# branches: +# - "main" +# tags: +# - version-* +# paths-ignore: +# - "**/memilio-epidata/**" +# pull_request: +# types: [opened, reopened, synchronize, ready_for_review] +# paths-ignore: +# - "**/memilio-epidata/**" +# workflow_dispatch: -concurrency: - group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.pull_request.number || github.run_id }} - cancel-in-progress: true +# concurrency: +# group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.pull_request.number || github.run_id }} +# cancel-in-progress: true -jobs: - pre-commit: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - with: - python-version: 3.12 - - uses: pre-commit/action@v3.0.1 +# jobs: +# pre-commit: +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v4 +# - uses: actions/setup-python@v5 +# with: +# python-version: 3.12 +# - uses: pre-commit/action@v3.0.1 - build-cpp-gcc_clang: - if: github.event.pull_request.draft == false - strategy: - matrix: - compiler: ["gcc", "clang"] - config: ["Debug", "Release"] - version: ["latest", "min"] - include: - - version: "latest" - os: "ubuntu-latest" - - version: "min" - os: "ubuntu-22.04" - runs-on: ${{ matrix.os }} - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/linux-build - with: - compiler: ${{ matrix.compiler }} - config: ${{ matrix.config }} - version: ${{ matrix.version }} - coverage: ${{ (matrix.compiler == 'gcc' && matrix.config == 'Debug' && matrix.version == 'latest') && 'ON' || 'OFF' }} # `c && t || f` is (usually) equivalent to `c ? t : f` - sanitizers: ${{ (matrix.compiler == 'gcc' && matrix.config == 'Debug' && matrix.version == 'latest') && 'ON' || 'OFF' }} +# build-cpp-gcc_clang: +# if: github.event.pull_request.draft == false +# strategy: +# matrix: +# compiler: ["gcc", "clang"] +# config: ["Debug", "Release"] +# version: ["latest", "min"] +# include: +# - version: "latest" +# os: "ubuntu-latest" +# - version: "min" +# os: "ubuntu-22.04" +# runs-on: ${{ matrix.os }} +# steps: +# - uses: actions/checkout@v4 +# - uses: ./.github/actions/linux-build +# with: +# compiler: ${{ matrix.compiler }} +# config: ${{ matrix.config }} +# version: ${{ matrix.version }} +# coverage: ${{ (matrix.compiler == 'gcc' && matrix.config == 'Debug' && matrix.version == 'latest') && 'ON' || 'OFF' }} # `c && t || f` is (usually) equivalent to `c ? t : f` +# sanitizers: ${{ (matrix.compiler == 'gcc' && matrix.config == 'Debug' && matrix.version == 'latest') && 'ON' || 'OFF' }} - build-cpp-gcc-no-optional-deps: - if: github.event.pull_request.draft == false - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/linux-build - with: - compiler: gcc - version: latest - config: Release - optional-dependencies: OFF +# build-cpp-gcc-no-optional-deps: +# if: github.event.pull_request.draft == false +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v4 +# - uses: ./.github/actions/linux-build +# with: +# compiler: gcc +# version: latest +# config: Release +# optional-dependencies: OFF - build-cpp-gcc-openmp: - if: github.event.pull_request.draft == false - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/linux-build - with: - compiler: gcc - version: latest - config: Release - openmp: ON +# build-cpp-gcc-openmp: +# if: github.event.pull_request.draft == false +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v4 +# - uses: ./.github/actions/linux-build +# with: +# compiler: gcc +# version: latest +# config: Release +# openmp: ON - build-cpp-msvc: - if: github.event.pull_request.draft == false - strategy: - matrix: - config: ["Debug", "Release"] - version: ["latest", "min"] - include: - - version: "latest" - os: "windows-2025" - - version: "min" - os: "windows-2022" - runs-on: ${{ matrix.os }} - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/windows-build - with: - config: ${{ matrix.config }} - version: ${{ matrix.version }} +# build-cpp-msvc: +# if: github.event.pull_request.draft == false +# strategy: +# matrix: +# config: ["Debug", "Release"] +# version: ["latest", "min"] +# include: +# - version: "latest" +# os: "windows-2025" +# - version: "min" +# os: "windows-2022" +# runs-on: ${{ matrix.os }} +# steps: +# - uses: actions/checkout@v4 +# - uses: ./.github/actions/windows-build +# with: +# config: ${{ matrix.config }} +# version: ${{ matrix.version }} - build-cpp-msvc-no-optional-deps: - if: github.event.pull_request.draft == false - runs-on: windows-2025 - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/windows-build - with: - config: Release - version: latest - optional-dependencies: OFF +# build-cpp-msvc-no-optional-deps: +# if: github.event.pull_request.draft == false +# runs-on: windows-2025 +# steps: +# - uses: actions/checkout@v4 +# - uses: ./.github/actions/windows-build +# with: +# config: Release +# version: latest +# optional-dependencies: OFF - test-cpp-gcc_clang: - if: github.event.pull_request.draft == false - needs: build-cpp-gcc_clang - strategy: - matrix: - compiler: ["gcc", "clang"] - config: ["Debug", "Release"] - version: ["latest", "min"] - include: - - version: "latest" - os: "ubuntu-latest" - - version: "min" - os: "ubuntu-22.04" - runs-on: ${{ matrix.os }} - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/linux-test - with: - artifact-pattern: ${{ matrix.compiler }}-${{ matrix.version }}-${{ matrix.config }} - coverage: ${{ (matrix.compiler == 'gcc' && matrix.version == 'latest' && matrix.config == 'Debug') && 'ON' || 'OFF' }} +# test-cpp-gcc_clang: +# if: github.event.pull_request.draft == false +# needs: build-cpp-gcc_clang +# strategy: +# matrix: +# compiler: ["gcc", "clang"] +# config: ["Debug", "Release"] +# version: ["latest", "min"] +# include: +# - version: "latest" +# os: "ubuntu-latest" +# - version: "min" +# os: "ubuntu-22.04" +# runs-on: ${{ matrix.os }} +# steps: +# - uses: actions/checkout@v4 +# - uses: ./.github/actions/linux-test +# with: +# artifact-pattern: ${{ matrix.compiler }}-${{ matrix.version }}-${{ matrix.config }} +# coverage: ${{ (matrix.compiler == 'gcc' && matrix.version == 'latest' && matrix.config == 'Debug') && 'ON' || 'OFF' }} - test-cpp-gcc-sbml: - if: github.event.pull_request.draft == false - needs: build-cpp-gcc_clang - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/sbml-test +# test-cpp-gcc-sbml: +# if: github.event.pull_request.draft == false +# needs: build-cpp-gcc_clang +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v4 +# - uses: ./.github/actions/sbml-test - merge-test-artifacts: - needs: [test-cpp-gcc_clang, test-cpp-msvc, test-py-surrogatemodel] - runs-on: ubuntu-latest - steps: - - name: merge-coverage-artifacts - uses: actions/upload-artifact/merge@v4 - with: - name: test-cpp-coverage-reports - pattern: test-cpp-coverage-reports-* - - name: merge-linux-artifacts - uses: actions/upload-artifact/merge@v4 - with: - name: test-cpp-linux-report - pattern: test-cpp-linux-report-* - - name: merge-windows-artifacts - uses: actions/upload-artifact/merge@v4 - with: - name: test-cpp-win-report - pattern: test-cpp-win-report-* - - name: merge python reports - uses: actions/upload-artifact/merge@v4 - with: - name: test-py-coverage-reports-surrogatemodel - pattern: test-py-coverage-reports-surrogatemodel-* +# merge-test-artifacts: +# needs: [test-cpp-gcc_clang, test-cpp-msvc, test-py-surrogatemodel] +# runs-on: ubuntu-latest +# steps: +# - name: merge-coverage-artifacts +# uses: actions/upload-artifact/merge@v4 +# with: +# name: test-cpp-coverage-reports +# pattern: test-cpp-coverage-reports-* +# - name: merge-linux-artifacts +# uses: actions/upload-artifact/merge@v4 +# with: +# name: test-cpp-linux-report +# pattern: test-cpp-linux-report-* +# - name: merge-windows-artifacts +# uses: actions/upload-artifact/merge@v4 +# with: +# name: test-cpp-win-report +# pattern: test-cpp-win-report-* +# - name: merge python reports +# uses: actions/upload-artifact/merge@v4 +# with: +# name: test-py-coverage-reports-surrogatemodel +# pattern: test-py-coverage-reports-surrogatemodel-* - test-cpp-gcc-no-optional-deps: - if: github.event.pull_request.draft == false - needs: build-cpp-gcc-no-optional-deps - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/linux-test - with: - artifact-pattern: gcc-latest-Release - optional-deps: OFF +# test-cpp-gcc-no-optional-deps: +# if: github.event.pull_request.draft == false +# needs: build-cpp-gcc-no-optional-deps +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v4 +# - uses: ./.github/actions/linux-test +# with: +# artifact-pattern: gcc-latest-Release +# optional-deps: OFF - test-cpp-gcc-openmp: - if: github.event.pull_request.draft == false - needs: build-cpp-gcc-openmp - runs-on: ubuntu-latest - timeout-minutes: 30 - env: - OMP_NUM_THREADS: 4 - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/linux-test - with: - artifact-pattern: gcc-latest-Release - num-repeat: 10 - openmp: ON +# test-cpp-gcc-openmp: +# if: github.event.pull_request.draft == false +# needs: build-cpp-gcc-openmp +# runs-on: ubuntu-latest +# timeout-minutes: 30 +# env: +# OMP_NUM_THREADS: 4 +# steps: +# - uses: actions/checkout@v4 +# - uses: ./.github/actions/linux-test +# with: +# artifact-pattern: gcc-latest-Release +# num-repeat: 10 +# openmp: ON - test-cpp-msvc: - if: github.event.pull_request.draft == false - needs: build-cpp-msvc - strategy: - matrix: - config: ["Debug", "Release"] - version: ["latest", "min"] - include: - - version: "latest" - os: "windows-2025" - - version: "min" - os: "windows-2022" - runs-on: ${{ matrix.os }} - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/windows-test - with: - artifact-pattern: msvc-${{ matrix.version }}-${{ matrix.config }} +# test-cpp-msvc: +# if: github.event.pull_request.draft == false +# needs: build-cpp-msvc +# strategy: +# matrix: +# config: ["Debug", "Release"] +# version: ["latest", "min"] +# include: +# - version: "latest" +# os: "windows-2025" +# - version: "min" +# os: "windows-2022" +# runs-on: ${{ matrix.os }} +# steps: +# - uses: actions/checkout@v4 +# - uses: ./.github/actions/windows-test +# with: +# artifact-pattern: msvc-${{ matrix.version }}-${{ matrix.config }} - test-cpp-msvc-no-optional-deps: - if: github.event.pull_request.draft == false - needs: build-cpp-msvc-no-optional-deps - runs-on: windows-2025 - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/windows-test - with: - artifact-pattern: msvc-latest-Release - optional-deps: OFF +# test-cpp-msvc-no-optional-deps: +# if: github.event.pull_request.draft == false +# needs: build-cpp-msvc-no-optional-deps +# runs-on: windows-2025 +# steps: +# - uses: actions/checkout@v4 +# - uses: ./.github/actions/windows-test +# with: +# artifact-pattern: msvc-latest-Release +# optional-deps: OFF - run_examples-cpp-gcc_clang: - if: github.event.pull_request.draft == false - needs: build-cpp-gcc_clang - strategy: - matrix: - compiler: ["gcc", "clang"] - config: ["Debug", "Release"] - version: ["latest", "min"] - include: - - version: "latest" - os: "ubuntu-latest" - - version: "min" - os: "ubuntu-22.04" - runs-on: ${{ matrix.os }} - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/linux-run_examples - with: - build-artifact: build-cpp-linux-${{ matrix.compiler }}-${{ matrix.version }}-${{ matrix.config }} +# run_examples-cpp-gcc_clang: +# if: github.event.pull_request.draft == false +# needs: build-cpp-gcc_clang +# strategy: +# matrix: +# compiler: ["gcc", "clang"] +# config: ["Debug", "Release"] +# version: ["latest", "min"] +# include: +# - version: "latest" +# os: "ubuntu-latest" +# - version: "min" +# os: "ubuntu-22.04" +# runs-on: ${{ matrix.os }} +# steps: +# - uses: actions/checkout@v4 +# - uses: ./.github/actions/linux-run_examples +# with: +# build-artifact: build-cpp-linux-${{ matrix.compiler }}-${{ matrix.version }}-${{ matrix.config }} - run_examples-cpp-msvc: - if: github.event.pull_request.draft == false - needs: build-cpp-msvc - strategy: - matrix: - config: ["Debug", "Release"] - version: ["latest", "min"] - include: - - version: "latest" - os: "windows-2025" - - version: "min" - os: "windows-2022" - runs-on: ${{ matrix.os }} - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/windows-run_examples - with: - build-artifact: build-cpp-windows-msvc-${{ matrix.version }}-${{ matrix.config }} +# run_examples-cpp-msvc: +# if: github.event.pull_request.draft == false +# needs: build-cpp-msvc +# strategy: +# matrix: +# config: ["Debug", "Release"] +# version: ["latest", "min"] +# include: +# - version: "latest" +# os: "windows-2025" +# - version: "min" +# os: "windows-2022" +# runs-on: ${{ matrix.os }} +# steps: +# - uses: actions/checkout@v4 +# - uses: ./.github/actions/windows-run_examples +# with: +# build-artifact: build-cpp-windows-msvc-${{ matrix.version }}-${{ matrix.config }} - build-py-generation: - if: github.event.pull_request.draft == false - runs-on: ubuntu-latest - container: quay.io/pypa/manylinux_2_28_x86_64 - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/build-py - with: - package: generation +# build-py-generation: +# if: github.event.pull_request.draft == false +# runs-on: ubuntu-latest +# container: quay.io/pypa/manylinux_2_28_x86_64 +# steps: +# - uses: actions/checkout@v4 +# - uses: ./.github/actions/build-py +# with: +# package: generation - build-py-simulation: - if: github.event.pull_request.draft == false - runs-on: ubuntu-latest - container: quay.io/pypa/manylinux_2_28_x86_64 - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/build-py - with: - package: simulation +# build-py-simulation: +# if: github.event.pull_request.draft == false +# runs-on: ubuntu-latest +# container: quay.io/pypa/manylinux_2_28_x86_64 +# steps: +# - uses: actions/checkout@v4 +# - uses: ./.github/actions/build-py +# with: +# package: simulation - build-py-surrogatemodel: - if: github.event.pull_request.draft == false - runs-on: ubuntu-latest - container: quay.io/pypa/manylinux_2_28_x86_64 - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/build-py - with: - package: surrogatemodel +# build-py-surrogatemodel: +# if: github.event.pull_request.draft == false +# runs-on: ubuntu-latest +# container: quay.io/pypa/manylinux_2_28_x86_64 +# steps: +# - uses: actions/checkout@v4 +# - uses: ./.github/actions/build-py +# with: +# package: surrogatemodel - test-py-generation: - if: github.event.pull_request.draft == false - strategy: - matrix: - version: ["3.8", "3.12"] - needs: build-py-generation - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/test-py - with: - package: generation +# test-py-generation: +# if: github.event.pull_request.draft == false +# strategy: +# matrix: +# version: ["3.8", "3.12"] +# needs: build-py-generation +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v4 +# - uses: ./.github/actions/test-py +# with: +# package: generation - test-py-simulation: - if: github.event.pull_request.draft == false - needs: build-py-simulation - strategy: - matrix: - version: ["3.8", "3.12"] - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/test-py - with: - package: simulation +# test-py-simulation: +# if: github.event.pull_request.draft == false +# needs: build-py-simulation +# strategy: +# matrix: +# version: ["3.8", "3.12"] +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v4 +# - uses: ./.github/actions/test-py +# with: +# package: simulation - test-py-surrogatemodel: - if: github.event.pull_request.draft == false - needs: [build-py-surrogatemodel, build-py-simulation] - strategy: - matrix: - version: ["3.8", "3.12"] - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/test-py - with: - version: ${{ matrix.version }} - package: surrogatemodel - coverage: ON +# test-py-surrogatemodel: +# if: github.event.pull_request.draft == false +# needs: [build-py-surrogatemodel, build-py-simulation] +# strategy: +# matrix: +# version: ["3.8", "3.12"] +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v4 +# - uses: ./.github/actions/test-py +# with: +# version: ${{ matrix.version }} +# package: surrogatemodel +# coverage: ON - codecov: - if: github.event.pull_request.draft == false - needs: merge-test-artifacts - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Install dependencies - run: | - sudo apt-get -qq update - sudo apt-get -qq -y install git curl - - name: Download python coverage report - uses: actions/download-artifact@v4 - with: - name: test-py-coverage-reports-surrogatemodel - - name: Download cpp coverage report - uses: actions/download-artifact@v4 - with: - name: test-cpp-coverage-reports - - name: Deploy to codecov.io - uses: codecov/codecov-action@v3 - with: - token: ${{ secrets.CODECOV_TOKEN }} - directory: ./coverage_python - files: ./coverage_python/**,./coverage.info - verbose: true +# codecov: +# if: github.event.pull_request.draft == false +# needs: merge-test-artifacts +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v4 +# - name: Install dependencies +# run: | +# sudo apt-get -qq update +# sudo apt-get -qq -y install git curl +# - name: Download python coverage report +# uses: actions/download-artifact@v4 +# with: +# name: test-py-coverage-reports-surrogatemodel +# - name: Download cpp coverage report +# uses: actions/download-artifact@v4 +# with: +# name: test-cpp-coverage-reports +# - name: Deploy to codecov.io +# uses: codecov/codecov-action@v3 +# with: +# token: ${{ secrets.CODECOV_TOKEN }} +# directory: ./coverage_python +# files: ./coverage_python/**,./coverage.info +# verbose: true diff --git a/.github/workflows/message_bot.yml b/.github/workflows/message_bot.yml index cd4f322ca1..55fdb1545d 100644 --- a/.github/workflows/message_bot.yml +++ b/.github/workflows/message_bot.yml @@ -1,134 +1,134 @@ -# .github/workflows/discussion-monitor.yml -name: Discussion Monitor +# # .github/workflows/discussion-monitor.yml +# name: Discussion Monitor -on: - schedule: - - cron: '0 9 * * *' +# on: +# schedule: +# - cron: '0 9 * * *' -jobs: - check-discussions: - runs-on: ubuntu-latest - permissions: - contents: read - discussions: read - steps: - - name: Check for new discussions - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - MATTERMOST_WEBHOOK_URL: ${{ secrets.MATTERMOST_WEBHOOK_URL }} - run: | - npm install @octokit/rest - cat > check.js << 'EOF' - const { Octokit } = require('@octokit/rest'); +# jobs: +# check-discussions: +# runs-on: ubuntu-latest +# permissions: +# contents: read +# discussions: read +# steps: +# - name: Check for new discussions +# env: +# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +# MATTERMOST_WEBHOOK_URL: ${{ secrets.MATTERMOST_WEBHOOK_URL }} +# run: | +# npm install @octokit/rest +# cat > check.js << 'EOF' +# const { Octokit } = require('@octokit/rest'); - const octokit = new Octokit({ auth: process.env.GITHUB_TOKEN }); +# const octokit = new Octokit({ auth: process.env.GITHUB_TOKEN }); - async function check() { - const since = new Date(); - since.setHours(since.getHours() - 25); +# async function check() { +# const since = new Date(); +# since.setHours(since.getHours() - 25); - const [owner, repo] = process.env.GITHUB_REPOSITORY.split('/'); - console.log(`Checking discussions for ${owner}/${repo}`); +# const [owner, repo] = process.env.GITHUB_REPOSITORY.split('/'); +# console.log(`Checking discussions for ${owner}/${repo}`); - try { - const response = await octokit.graphql(` - query { - repository(owner: "${owner}", name: "${repo}") { - discussions(first: 10, orderBy: {field: CREATED_AT, direction: DESC}) { - nodes { - createdAt - title - url - number - author { - login - } - category { - name - emoji - } - } - } - } - } - `); +# try { +# const response = await octokit.graphql(` +# query { +# repository(owner: "${owner}", name: "${repo}") { +# discussions(first: 10, orderBy: {field: CREATED_AT, direction: DESC}) { +# nodes { +# createdAt +# title +# url +# number +# author { +# login +# } +# category { +# name +# emoji +# } +# } +# } +# } +# } +# `); - console.log('Full GraphQL response:', JSON.stringify(response, null, 2)); +# console.log('Full GraphQL response:', JSON.stringify(response, null, 2)); - if (!response || !response.repository) { - console.log('Repository not found or discussions not enabled'); - console.log('Response keys:', Object.keys(response || {})); - return; - } +# if (!response || !response.repository) { +# console.log('Repository not found or discussions not enabled'); +# console.log('Response keys:', Object.keys(response || {})); +# return; +# } - if (!response.repository.discussions) { - console.log('Discussions not available for this repository'); - return; - } +# if (!response.repository.discussions) { +# console.log('Discussions not available for this repository'); +# return; +# } - const newDiscussions = response.repository.discussions.nodes.filter( - d => new Date(d.createdAt) > since - ); +# const newDiscussions = response.repository.discussions.nodes.filter( +# d => new Date(d.createdAt) > since +# ); - console.log(`Found ${newDiscussions.length} new discussions`); +# console.log(`Found ${newDiscussions.length} new discussions`); - if (newDiscussions.length > 0) { - let message; +# if (newDiscussions.length > 0) { +# let message; - if (newDiscussions.length === 1) { - const discussion = newDiscussions[0]; - message = { - text: `${discussion.category.emoji || '💬'} New Discussion on ${owner}/${repo} +# if (newDiscussions.length === 1) { +# const discussion = newDiscussions[0]; +# message = { +# text: `${discussion.category.emoji || '💬'} New Discussion on ${owner}/${repo} - **[${discussion.title}](${discussion.url})** +# **[${discussion.title}](${discussion.url})** - 👤 **Author:** ${discussion.author.login} - 📂 **Category:** ${discussion.category.name} - 🔢 **Discussion #${discussion.number}**`, - username: "GitHub Discussion Bot", - icon_emoji: ":github:" - }; - } else { - const discussionList = newDiscussions.map(d => - `- ${d.category.emoji || '💬'} **[${d.title}](${d.url})** by ${d.author.login}` - ).join('\n'); +# 👤 **Author:** ${discussion.author.login} +# 📂 **Category:** ${discussion.category.name} +# 🔢 **Discussion #${discussion.number}**`, +# username: "GitHub Discussion Bot", +# icon_emoji: ":github:" +# }; +# } else { +# const discussionList = newDiscussions.map(d => +# `- ${d.category.emoji || '💬'} **[${d.title}](${d.url})** by ${d.author.login}` +# ).join('\n'); - message = { - text: `🎉 ${newDiscussions.length} New Discussions on ${owner}/${repo} +# message = { +# text: `🎉 ${newDiscussions.length} New Discussions on ${owner}/${repo} - ${discussionList} +# ${discussionList} - --- - *Check out the latest discussions above!*`, - username: "GitHub Discussion Bot", - icon_emoji: ":github:" - }; - } +# --- +# *Check out the latest discussions above!*`, +# username: "GitHub Discussion Bot", +# icon_emoji: ":github:" +# }; +# } - const response = await fetch(process.env.MATTERMOST_WEBHOOK_URL, { - method: 'POST', - headers: { 'Content-Type': 'application/json' }, - body: JSON.stringify(message) - }); - console.log('Mattermost notification sent'); - } - } catch (error) { - console.error('Error details:', error); - if (process.env.MATTERMOST_WEBHOOK_URL) { - await fetch(process.env.MATTERMOST_WEBHOOK_URL, { - method: 'POST', - headers: { 'Content-Type': 'application/json' }, - body: JSON.stringify({ - text: '⚠️ **GitHub Discussion Bot Error**\nThere was an error checking discussions. Please check the workflow logs.', - username: "GitHub Discussion Bot", - icon_emoji: ":warning:" - }) - }); - } - } - } +# const response = await fetch(process.env.MATTERMOST_WEBHOOK_URL, { +# method: 'POST', +# headers: { 'Content-Type': 'application/json' }, +# body: JSON.stringify(message) +# }); +# console.log('Mattermost notification sent'); +# } +# } catch (error) { +# console.error('Error details:', error); +# if (process.env.MATTERMOST_WEBHOOK_URL) { +# await fetch(process.env.MATTERMOST_WEBHOOK_URL, { +# method: 'POST', +# headers: { 'Content-Type': 'application/json' }, +# body: JSON.stringify({ +# text: '⚠️ **GitHub Discussion Bot Error**\nThere was an error checking discussions. Please check the workflow logs.', +# username: "GitHub Discussion Bot", +# icon_emoji: ":warning:" +# }) +# }); +# } +# } +# } - check().catch(console.error); - EOF - node check.js +# check().catch(console.error); +# EOF +# node check.js diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000000..15b092d12f --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.13) +project(memilio-simulation) + +set(CMAKE_CXX_STANDARD "20") +set(CMAKE_CXX_STANDARD_REQUIRED "20") + +# add in C++ library +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/cpp ${CMAKE_CURRENT_BINARY_DIR}/cpp EXCLUDE_FROM_ALL) + +add_subdirectory(pycode/memilio-simulation) \ No newline at end of file diff --git a/pycode/memilio-simulation/CMakeLists.txt b/pycode/memilio-simulation/CMakeLists.txt index f54390d920..94ae9184b0 100644 --- a/pycode/memilio-simulation/CMakeLists.txt +++ b/pycode/memilio-simulation/CMakeLists.txt @@ -1,9 +1,3 @@ -cmake_minimum_required(VERSION 3.13) -project(memilio-python) - -set(CMAKE_CXX_STANDARD "20") -set(CMAKE_CXX_STANDARD_REQUIRED "20") - option(MEMILIO_USE_BUNDLED_PYBIND11 "Use pybind11 bundled with this library." ON) mark_as_advanced(MEMILIO_USE_BUNDLED_PYBIND11) @@ -52,9 +46,6 @@ else() find_package(pybind11 REQUIRED) endif() -# add in C++ library -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../../cpp ${CMAKE_CURRENT_BINARY_DIR}/cpp EXCLUDE_FROM_ALL) - # a list of all "LINKED_LIBRARIES" that are given to add_pymio_module. will contain duplicates # used for wheel installation set(PYMIO_MEMILIO_LIBS_LIST) diff --git a/pycode/memilio-simulation/pyproject.toml b/pycode/memilio-simulation/pyproject.toml deleted file mode 100644 index d7bc24b90f..0000000000 --- a/pycode/memilio-simulation/pyproject.toml +++ /dev/null @@ -1,39 +0,0 @@ -[build-system] -requires = [ - "scikit-build-core>=0.9.0", - "setuptools>=68", - "wheel" -] -build-backend = "scikit_build_core.build" - -[project] -name = "memilio-simulation" -version = "1.0.0" -description = "Part of MEmilio project, python bindings to the C++ libraries that contain the models and simulations." -readme = "README.md" -requires-python = ">=3.8" -license = { text = "Apache-2.0" } -authors = [{ name = "MEmilio Team" }] -maintainers = [ - { email = "martin.kuehn@dlr.de" } -] -dependencies = [ - # smaller numpy versions cause a security issue, 1.25 does not work together with pyfakefs - "numpy>=1.22,!=1.25.*", - # smaller pandas versions contain a bug that sometimes prevents reading - "pandas>=2.0.0" -] - -[project.optional-dependencies] -dev = [] - -[project.urls] -Homepage = "https://github.com/SciCompMod/memilio" -Team = "https://memilio.readthedocs.io/en/latest/team.html" - -[tool.scikit-build] -cmake.version = ">=3.13" -cmake.args = ["-DMEMILIO_BUILD_SHARED_LIBS:BOOL=ON"] -wheel.packages = ["memilio"] -wheel.install-dir = "memilio/simulation" -build-dir = "../build/memilio-simulation" diff --git a/pyproject.toml b/pyproject.toml index 2f12cc6b19..260a1a979d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,55 @@ +[project] +name = "memilio" +version = "1.0.0" +description = "Part of MEmilio project, python bindings to the C++ libraries that contain the models and simulations." +readme = "README.md" +requires-python = ">=3.8" +license = { text = "Apache-2.0" } +authors = [{ name = "MEmilio Team" }] +maintainers = [ + { email = "martin.kuehn@dlr.de" } +] +dependencies = [ + # smaller numpy versions cause a security issue, 1.25 does not work together with pyfakefs + "numpy>=1.22,!=1.25.*", + # smaller pandas versions contain a bug that sometimes prevents reading + "pandas>=2.0.0" +] + +[project.optional-dependencies] +dev = [] + +[project.urls] +Homepage = "https://github.com/SciCompMod/memilio" +Team = "https://memilio.readthedocs.io/en/latest/team.html" + +[build-system] +requires = [ + "scikit-build-core>=0.9.0", + "setuptools>=68", + "wheel" +] +build-backend = "scikit_build_core.build" + +[tool.scikit-build] +cmake.version = ">=3.13" +cmake.args = ["-DMEMILIO_BUILD_SHARED_LIBS:BOOL=ON"] +wheel.packages = ["memilio"] +wheel.install-dir = "memilio/simulation" +build-dir = "../build/memilio-simulation" + +[tool.setuptools] +packages = ["pycode/memilio-epidata","pycode/memilio-generation","pycode/memilio-plot","pycode/memilio-simulation","pycode/memilio-surrogatemodel"] + +[tool.cibuildwheel] +# Disable some wheels +skip = ["pp*", "*musllinux*", "*_i686", "*-win32"] # "*_i686" works, skip for now for further testing + [tool.autopep8] max-line-length = 79 [tool.pyright] include = ["pycode"] -exclude = ["pycode/memilio-simulation"] \ No newline at end of file +exclude = ["pycode/memilio-simulation"] + +