<commit_before>name: CI

on:
  push:
    branches:
      - 'master'
      - 'pymbar4'
      - 'gha'
  pull_request:
    branches:
      - 'master'
      - 'pymbar4'
      - 'gha'
  schedule:
    # Nightly Tests
    - cron: '0 0 * * *'

jobs:

  test:
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        os: [macOS-latest, ubuntu-latest, windows-latest]
        python-version: [3.7, 3.8]
    env:
      PYVER: ${{ matrix.python-version }}
      CI_OS: ${{ matrix.os }}
      PACKAGE: "pymbar"

    steps:
    - name: Checkout the code
      uses: actions/checkout@v1

    - name: Additional info about the build
      shell: bash
      run: |
        uname -a
        df -h
        ulimit -a

    - name: Fix conda in MacOS
      shell: bash
      if: startsWith(matrix.os, 'macOS')
      run: |
        sudo chown -R $(id -u):$(id -g) ${CONDA}

    - name: Create environment for package
      shell: bash
      run: |
        . devtools/github-actions/initialize_conda.sh
        conda activate
        conda info
        python devtools/scripts/create_conda_env.py -n=test -p=$PYVER devtools/conda-envs/test_env.yaml

    - name: Install package
      shell: bash
      run: |
        . devtools/github-actions/initialize_conda.sh
        conda activate test
        python -m pip install . --no-deps
        conda list --show-channel-urls

    - name: Run tests (pytest)
      shell: bash
      run: |
        . devtools/github-actions/initialize_conda.sh
        conda activate test
        pytest -v --cov=$PACKAGE --cov-report=xml --color=yes --doctest-modules $PACKAGE/

    - name: Run examples
      shell: bash
      run: |
        . devtools/github-actions/initialize_conda.sh
        conda activate test
        ### constant-force-optical-trap
        cd examples/constant-force-optical-trap
        python extract-data.py
        python force-bias-optical-trap.py
        ### harmonic-oscillators
        cd ../harmonic-oscillators
        python harmonic-oscillators.py
        python harmonic-oscillators-distributions.py
        cd ../heat-capacity
        python heat-capacity.py -b 2
        ### parallel-tempering-2dpmf
        cd ../parallel-tempering-2dpmf
        python parallel-tempering-2dpmf.py
        ### umbrella-sampling-pmf
        cd ../umbrella-sampling-pmf
        python umbrella-sampling.py
        python umbrella-sampling-smoothpmf.py

    - name: CodeCov
      uses: codecov/codecov-action@v1
      with:
        token: ${{ secrets.CODECOV_TOKEN }}
        file: ./coverage.xml
        flags: unittests
        yml: ./.codecov.yml

  lint-format:
    runs-on: ubuntu-latest
    env:
      CI_OS: ubuntu-latest
      PACKAGE: "pymbar"
      PYVER: "3.7"

    steps:
    - name: Checkout the code
      uses: actions/checkout@v1

    - name: Install linter and formatter
      shell: bash
      run: |
        . devtools/github-actions/initialize_conda.sh
        conda activate
        python devtools/scripts/create_conda_env.py -n=test -p=$PYVER devtools/conda-envs/test_env.yaml
        conda activate test
        conda install pylint black

    - name: Run pylint<commit_msg>Fix filepath in CI yaml<commit_after>name: CI

on:
  push:
    branches:
      - 'master'
      - 'pymbar4'
      - 'gha'
  pull_request:
    branches:
      - 'master'
      - 'pymbar4'
      - 'gha'
  schedule:
    # Nightly Tests
    - cron: '0 0 * * *'

jobs:

  test:
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        os: [macOS-latest, ubuntu-latest, windows-latest]
        python-version: [3.7, 3.8]
    env:
      PYVER: ${{ matrix.python-version }}
      CI_OS: ${{ matrix.os }}
      PACKAGE: "pymbar"

    steps:
    - name: Checkout the code
      uses: actions/checkout@v1

    - name: Additional info about the build
      shell: bash
      run: |
        uname -a
        df -h
        ulimit -a

    - name: Fix conda in MacOS
      shell: bash
      if: startsWith(matrix.os, 'macOS')
      run: |
        sudo chown -R $(id -u):$(id -g) ${CONDA}

    - name: Create environment for package
      shell: bash
      run: |
        . devtools/github-actions/initialize_conda.sh
        conda activate
        conda info
        python devtools/scripts/create_conda_env.py -n=test -p=$PYVER devtools/conda-envs/test_env.yaml

    - name: Install package
      shell: bash
      run: |
        . devtools/github-actions/initialize_conda.sh
        conda activate test
        python -m pip install . --no-deps
        conda list --show-channel-urls

    - name: Run tests (pytest)
      shell: bash
      run: |
        . devtools/github-actions/initialize_conda.sh
        conda activate test
        pytest -v --cov=$PACKAGE --cov-report=xml --color=yes --doctest-modules $PACKAGE/

    - name: Run examples
      shell: bash
      run: |
        . devtools/github-actions/initialize_conda.sh
        conda activate test
        ### constant-force-optical-trap
        cd examples/constant-force-optical-trap
        python extract-data.py
        python force-bias-optical-trap.py
        ### harmonic-oscillators
        cd ../harmonic-oscillators
        python harmonic-oscillators.py
        python harmonic-oscillators-distributions.py
        cd ../heat-capacity
        python heat-capacity.py -b 2
        ### parallel-tempering-2dpmf
        cd ../parallel-tempering-2dpmf
        python parallel-tempering-2dpmf.py
        ### umbrella-sampling-pmf
        cd ../umbrella-sampling-pmf
        python umbrella-sampling.py
        python umbrella-sampling-advanced-pmf.py

    - name: CodeCov
      uses: codecov/codecov-action@v1
      with:
        token: ${{ secrets.CODECOV_TOKEN }}
        file: ./coverage.xml
        flags: unittests
        yml: ./.codecov.yml

  lint-format:
    runs-on: ubuntu-latest
    env:
      CI_OS: ubuntu-latest
      PACKAGE: "pymbar"
      PYVER: "3.7"

    steps:
    - name: Checkout the code
      uses: actions/checkout@v1

    - name: Install linter and formatter
      shell: bash
      run: |
        . devtools/github-actions/initialize_conda.sh
        conda activate
        python devtools/scripts/create_conda_env.py -n=test -p=$PYVER devtools/conda-envs/test_env.yaml
        conda activate test
        conda install pylint black

    - name: Run pylint
{'fraction_non_alphanumeric': 0.10640316205533597, 'fraction_numerical': 0.005375494071146245, 'mean_word_length': 1.8165627782724845, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3068008', 'n_tokens_mistral': 2165, 'n_tokens_neox': 2032, 'n_words': 469}