From 7511152dfc5d6977deb01a99db6b66f87d7b630b Mon Sep 17 00:00:00 2001 From: Mohamed Sameh Date: Fri, 20 Dec 2024 19:02:36 +0100 Subject: [PATCH 1/7] fix the nan bug --- alphadia/outputaccumulator.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/alphadia/outputaccumulator.py b/alphadia/outputaccumulator.py index 9f1e8547..76c14cd2 100644 --- a/alphadia/outputaccumulator.py +++ b/alphadia/outputaccumulator.py @@ -585,8 +585,8 @@ def ms2_quality_control( # use the precursor for MS2 learning if the median correlation is above the cutoff use_for_ms2[i] = median_correlation > precursor_correlation_cutoff - # Fix: Use loc to modify the original DataFrame instead of the view - spec_lib_base.fragment_intensity_df.loc[start_idx:stop_idx] = ( + # Fix: Use iloc to modify the original DataFrame instead of the view + spec_lib_base.fragment_intensity_df.iloc[start_idx:stop_idx] = ( fragment_intensity_view.values * ( fragment_correlation_view From 8cb6e1b9d69cdeb59294e67c8de152183dedc346 Mon Sep 17 00:00:00 2001 From: mschwoerer <82171591+mschwoer@users.noreply.github.com> Date: Fri, 20 Dec 2024 16:55:54 +0100 Subject: [PATCH 2/7] install mono in CI install mono in CI --- .github/workflows/_run_tests.yml | 5 +++++ misc/pip_install.sh | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/_run_tests.yml b/.github/workflows/_run_tests.yml index e5032c14..92436ac9 100644 --- a/.github/workflows/_run_tests.yml +++ b/.github/workflows/_run_tests.yml @@ -34,6 +34,11 @@ jobs: - name: Conda info shell: bash -l {0} run: conda info + - name: Install mono + shell: bash -l {0} + run: | + conda install mono + - name: Perform pip installation with all stable dependencies shell: bash -l {0} run: | diff --git a/misc/pip_install.sh b/misc/pip_install.sh index bbfd5352..2ca0b8b8 100644 --- a/misc/pip_install.sh +++ b/misc/pip_install.sh @@ -4,7 +4,7 @@ INSTALL_TYPE=$1 # stable, loose, etc.. ENV_NAME=${2:-alphadia} PYTHON_VERSION=${3:-3.11} -conda create -n $ENV_NAME python=$PYTHON_VERSION -y +conda create -n $ENV_NAME python=$PYTHON_VERSION mono -y if [ "$INSTALL_TYPE" = "loose" ]; then INSTALL_STRING="" From b00c6de6214426a597d1e6ac89b9542b10d265f5 Mon Sep 17 00:00:00 2001 From: mschwoerer <82171591+mschwoer@users.noreply.github.com> Date: Fri, 20 Dec 2024 22:14:02 +0100 Subject: [PATCH 3/7] no mono for windows --- .github/workflows/_run_tests.yml | 6 +++--- misc/pip_install.sh | 7 ++++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/_run_tests.yml b/.github/workflows/_run_tests.yml index 92436ac9..7689ecf3 100644 --- a/.github/workflows/_run_tests.yml +++ b/.github/workflows/_run_tests.yml @@ -35,17 +35,17 @@ jobs: shell: bash -l {0} run: conda info - name: Install mono + if: ${{ runner.os != 'windows-latest' }} shell: bash -l {0} run: | conda install mono - - name: Perform pip installation with all stable dependencies shell: bash -l {0} run: | cd misc - . ./${{ inputs.install-script }} alphadia ${{ inputs.python-version }} + . ./${{ inputs.install-script }} alphadia ${{ inputs.python-version }} ${{ runner.os != 'windows-latest' }} - name: Run tests shell: bash -l {0} run: | cd tests - . ./${{ inputs.test-script }} alphadia ${{ inputs.python-version }} + . ./${{ inputs.test-script }} alphadia ${{ inputs.python-version }} ${{ runner.os != 'windows-latest' }} diff --git a/misc/pip_install.sh b/misc/pip_install.sh index 2ca0b8b8..b48ee03e 100644 --- a/misc/pip_install.sh +++ b/misc/pip_install.sh @@ -3,8 +3,13 @@ set -e -u INSTALL_TYPE=$1 # stable, loose, etc.. ENV_NAME=${2:-alphadia} PYTHON_VERSION=${3:-3.11} +INSTALL_MONO=${4:-false} -conda create -n $ENV_NAME python=$PYTHON_VERSION mono -y +if [ "$INSTALL_MONO" = "true" ]; then + conda create -n $ENV_NAME python=$PYTHON_VERSION mono -y +else + conda create -n $ENV_NAME python=$PYTHON_VERSION -y +fi if [ "$INSTALL_TYPE" = "loose" ]; then INSTALL_STRING="" From 7d72682102a0fad90eb1b80cbe7cd8c7b166dfb3 Mon Sep 17 00:00:00 2001 From: mschwoerer <82171591+mschwoer@users.noreply.github.com> Date: Fri, 20 Dec 2024 22:38:08 +0100 Subject: [PATCH 4/7] fix no mono for windows --- .github/workflows/_run_tests.yml | 11 ++++++----- .github/workflows/branch-checks.yaml | 3 ++- .github/workflows/pip_installation.yml | 4 ++-- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/.github/workflows/_run_tests.yml b/.github/workflows/_run_tests.yml index 7689ecf3..0333c79e 100644 --- a/.github/workflows/_run_tests.yml +++ b/.github/workflows/_run_tests.yml @@ -1,5 +1,5 @@ # reusable workflow to run tests on different installation types and OS -name: run-tests +name: Run unit tests on ${{ inputs.os }} on: workflow_call: @@ -17,7 +17,8 @@ on: required: true type: string jobs: - run-unit-tests-stable-ubuntu: + run-unit-tests: + name: Unit tests [${{ inputs.os }}] runs-on: ${{ inputs.os }} steps: - uses: actions/checkout@v4 @@ -35,7 +36,7 @@ jobs: shell: bash -l {0} run: conda info - name: Install mono - if: ${{ runner.os != 'windows-latest' }} + if: ${{ inputs.os != 'windows-latest' }} shell: bash -l {0} run: | conda install mono @@ -43,9 +44,9 @@ jobs: shell: bash -l {0} run: | cd misc - . ./${{ inputs.install-script }} alphadia ${{ inputs.python-version }} ${{ runner.os != 'windows-latest' }} + . ./${{ inputs.install-script }} alphadia ${{ inputs.python-version }} ${{ inputs.os != 'windows-latest' }} - name: Run tests shell: bash -l {0} run: | cd tests - . ./${{ inputs.test-script }} alphadia ${{ inputs.python-version }} ${{ runner.os != 'windows-latest' }} + . ./${{ inputs.test-script }} alphadia ${{ inputs.python-version }} ${{ inputs.os != 'windows-latest' }} diff --git a/.github/workflows/branch-checks.yaml b/.github/workflows/branch-checks.yaml index 5fa58954..90677094 100644 --- a/.github/workflows/branch-checks.yaml +++ b/.github/workflows/branch-checks.yaml @@ -15,8 +15,9 @@ jobs: # For feature branches, we don't test the full matrix (os x [stable, loose]) in order to save time & resources. run-tests-stable: - name: Test stable pip installation on ubuntu-latest + name: Test 'stable' on ubuntu-latest strategy: + fail-fast: false matrix: os: [ubuntu-latest] python-version: ["3.10", "3.11", "3.12"] diff --git a/.github/workflows/pip_installation.yml b/.github/workflows/pip_installation.yml index 172f3b5a..92e6721b 100644 --- a/.github/workflows/pip_installation.yml +++ b/.github/workflows/pip_installation.yml @@ -21,7 +21,7 @@ concurrency: jobs: run-unit-tests-stable: - name: Test stable pip installation on 3 OS + name: Test 'stable' on ${{ matrix.os }} strategy: matrix: os: [ubuntu-latest, macos-13, windows-latest] @@ -34,7 +34,7 @@ jobs: test-script: ./run_unit_tests.sh run-unit-tests-loose: - name: Test loose pip installation on 3 OS + name: Test 'loose' on ${{ matrix.os }} strategy: matrix: os: [ ubuntu-latest, macos-13, windows-latest ] From c064a8f10051272342de49403d25d9caa16f38c6 Mon Sep 17 00:00:00 2001 From: mschwoerer <82171591+mschwoer@users.noreply.github.com> Date: Fri, 20 Dec 2024 22:42:18 +0100 Subject: [PATCH 5/7] add support for Windows 95 (TM) --- .github/workflows/_run_tests.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/_run_tests.yml b/.github/workflows/_run_tests.yml index 0333c79e..2e528439 100644 --- a/.github/workflows/_run_tests.yml +++ b/.github/workflows/_run_tests.yml @@ -36,7 +36,7 @@ jobs: shell: bash -l {0} run: conda info - name: Install mono - if: ${{ inputs.os != 'windows-latest' }} + if: ${{ contains(inputs.os, 'windows') == 'false' }} shell: bash -l {0} run: | conda install mono @@ -44,9 +44,9 @@ jobs: shell: bash -l {0} run: | cd misc - . ./${{ inputs.install-script }} alphadia ${{ inputs.python-version }} ${{ inputs.os != 'windows-latest' }} + . ./${{ inputs.install-script }} alphadia ${{ inputs.python-version }} ${{ contains(inputs.os, 'windows') == 'false' }} - name: Run tests shell: bash -l {0} run: | cd tests - . ./${{ inputs.test-script }} alphadia ${{ inputs.python-version }} ${{ inputs.os != 'windows-latest' }} + . ./${{ inputs.test-script }} alphadia ${{ inputs.python-version }} ${{ contains(inputs.os, 'windows') == 'false' }} From 99081d7706bcba30c44984d23bfde69ffb2dfe7d Mon Sep 17 00:00:00 2001 From: mschwoerer <82171591+mschwoer@users.noreply.github.com> Date: Fri, 20 Dec 2024 22:50:30 +0100 Subject: [PATCH 6/7] fix --- .github/workflows/_run_tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/_run_tests.yml b/.github/workflows/_run_tests.yml index 2e528439..59a8698e 100644 --- a/.github/workflows/_run_tests.yml +++ b/.github/workflows/_run_tests.yml @@ -1,5 +1,5 @@ # reusable workflow to run tests on different installation types and OS -name: Run unit tests on ${{ inputs.os }} +name: Run unit tests on: workflow_call: From afea9730ffae0867cd0456b90cc75e1a9a8514ae Mon Sep 17 00:00:00 2001 From: mschwoerer <82171591+mschwoer@users.noreply.github.com> Date: Fri, 20 Dec 2024 22:49:33 +0100 Subject: [PATCH 7/7] fix --- .github/workflows/_run_tests.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/_run_tests.yml b/.github/workflows/_run_tests.yml index 59a8698e..1cc32945 100644 --- a/.github/workflows/_run_tests.yml +++ b/.github/workflows/_run_tests.yml @@ -36,7 +36,7 @@ jobs: shell: bash -l {0} run: conda info - name: Install mono - if: ${{ contains(inputs.os, 'windows') == 'false' }} + if: ${{ !contains(inputs.os, 'windows') }} shell: bash -l {0} run: | conda install mono @@ -44,9 +44,9 @@ jobs: shell: bash -l {0} run: | cd misc - . ./${{ inputs.install-script }} alphadia ${{ inputs.python-version }} ${{ contains(inputs.os, 'windows') == 'false' }} + . ./${{ inputs.install-script }} alphadia ${{ inputs.python-version }} ${{ !contains(inputs.os, 'windows') }} - name: Run tests shell: bash -l {0} run: | cd tests - . ./${{ inputs.test-script }} alphadia ${{ inputs.python-version }} ${{ contains(inputs.os, 'windows') == 'false' }} + . ./${{ inputs.test-script }} alphadia ${{ inputs.python-version }} ${{ !contains(inputs.os, 'windows') }}