From e17cdfd46eec5e2959ab3ed36a044b03b983b34e Mon Sep 17 00:00:00 2001 From: llegregam Date: Tue, 21 Jan 2025 11:21:42 +0100 Subject: [PATCH 1/7] Fixed error when calling numpy through pandas Removed system exit on error --- isocor/ui/isocorcli.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/isocor/ui/isocorcli.py b/isocor/ui/isocorcli.py index 0785da3..291553c 100644 --- a/isocor/ui/isocorcli.py +++ b/isocor/ui/isocorcli.py @@ -2,6 +2,7 @@ import isocor as hr import isocor.ui.isocordb import pandas as pd +import numpy as np import io import logging from pathlib import Path @@ -148,7 +149,6 @@ def process(args): dictMetabolites[label] = None errors['labels'] = errors['labels'] + [label] logger.error("cannot construct {}: {}".format(label, err)) - sys.exit(2) logger.info('------------------------------------------------') logger.info('Correcting raw MS data...') @@ -170,15 +170,15 @@ def process(args): logger.info("{} - {}: processed".format(serie[0], label)) except Exception as err: isotopic_inchi = ['']*len(serie[1]) - valuesCorrected = ([pd.np.nan]*len(serie[1]), [pd.np.nan] - * len(serie[1]), [pd.np.nan]*len(serie[1]), pd.np.nan) + valuesCorrected = ([np.nan]*len(serie[1]), [np.nan] + * len(serie[1]), [np.nan]*len(serie[1]), np.nan) logger.error("{} - {}: {}".format(serie[0], label, err)) errors['measurements'] = errors['measurements'] + \ ["{} - {}".format(serie[0], label)] else: isotopic_inchi = ['']*len(serie[1]) - valuesCorrected = ([pd.np.nan]*len(serie[1]), [pd.np.nan] - * len(serie[1]), [pd.np.nan]*len(serie[1]), pd.np.nan) + valuesCorrected = ([np.nan]*len(serie[1]), [np.nan] + * len(serie[1]), [np.nan]*len(serie[1]), np.nan) errors['measurements'] = errors['measurements'] + \ ["{} - {}".format(serie[0], label)] logger.error( From 4cd4eceb5de8fa6a94f756cb847e32f5825eec90 Mon Sep 17 00:00:00 2001 From: llegregam Date: Tue, 21 Jan 2025 11:42:24 +0100 Subject: [PATCH 2/7] Fixed missing && in test_suite.yml --- .github/workflows/test_suite.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_suite.yml b/.github/workflows/test_suite.yml index a25bc1a..b7abfa1 100644 --- a/.github/workflows/test_suite.yml +++ b/.github/workflows/test_suite.yml @@ -27,7 +27,7 @@ jobs: architecture: x64 - name: Install Dependencies run: - python -m pip install --upgrade pip + python -m pip install --upgrade pip && pip install tox tox-gh-actions - name: Test with tox run: tox From 136a46656a91ec2f25d755d328c513c061f2d229 Mon Sep 17 00:00:00 2001 From: llegregam Date: Tue, 21 Jan 2025 11:48:03 +0100 Subject: [PATCH 3/7] Changed checkout action to v4 --- .github/workflows/test_suite.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_suite.yml b/.github/workflows/test_suite.yml index b7abfa1..3005462 100644 --- a/.github/workflows/test_suite.yml +++ b/.github/workflows/test_suite.yml @@ -19,7 +19,7 @@ jobs: python-version: [ '3.8', '3.9', '3.10', '3.11'] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python ${{matrix.python-version}} uses: actions/setup-python@v4 with: From bfbdcf6d01c0bbfccdc87a29a5508d8959f40c80 Mon Sep 17 00:00:00 2001 From: llegregam Date: Tue, 21 Jan 2025 11:50:24 +0100 Subject: [PATCH 4/7] changed python setup version --- .github/workflows/test_suite.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_suite.yml b/.github/workflows/test_suite.yml index 3005462..9c3f28d 100644 --- a/.github/workflows/test_suite.yml +++ b/.github/workflows/test_suite.yml @@ -21,7 +21,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: Set up Python ${{matrix.python-version}} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{matrix.python-version}} architecture: x64 From b97d43737700790ea97982adf0af2e64bded0f99 Mon Sep 17 00:00:00 2001 From: llegregam Date: Tue, 21 Jan 2025 11:56:38 +0100 Subject: [PATCH 5/7] created separate job for testing macos --- .github/workflows/test_suite.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/test_suite.yml b/.github/workflows/test_suite.yml index 9c3f28d..2e13794 100644 --- a/.github/workflows/test_suite.yml +++ b/.github/workflows/test_suite.yml @@ -31,3 +31,18 @@ jobs: pip install tox tox-gh-actions - name: Test with tox run: tox + test_macos: + runs-on: macos-latest + steps: + - uses: actions/checkout@v4 + - name: Set up Python 3.11 + uses: actions/setup-python@v5 + with: + python-version: '3.11' + architecture: x64 + - name: Install Dependencies + run: + python -m pip install --upgrade pip && + pip install tox tox-gh-actions + - name: Test with tox + run: tox From d861b453c3a0df07902ae12754f310b1d70ccb88 Mon Sep 17 00:00:00 2001 From: llegregam Date: Tue, 21 Jan 2025 11:57:11 +0100 Subject: [PATCH 6/7] created separate job for testing macos --- .github/workflows/test_suite.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_suite.yml b/.github/workflows/test_suite.yml index 2e13794..642c944 100644 --- a/.github/workflows/test_suite.yml +++ b/.github/workflows/test_suite.yml @@ -15,7 +15,7 @@ jobs: runs-on: ${{ matrix.os}} strategy: matrix: - os: [ubuntu-latest, windows-latest, macos-latest] + os: [ubuntu-latest, windows-latest] python-version: [ '3.8', '3.9', '3.10', '3.11'] steps: From 6356c135fa9356bdfd384161cd2afad2673e0dfd Mon Sep 17 00:00:00 2001 From: llegregam Date: Tue, 21 Jan 2025 11:59:46 +0100 Subject: [PATCH 7/7] Added comment explaining changes --- .github/workflows/test_suite.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test_suite.yml b/.github/workflows/test_suite.yml index 642c944..1147739 100644 --- a/.github/workflows/test_suite.yml +++ b/.github/workflows/test_suite.yml @@ -31,7 +31,9 @@ jobs: pip install tox tox-gh-actions - name: Test with tox run: tox - test_macos: +# We test macos differently because of new architecture of Apple Silicon processors. +# Details here: https://github.com/actions/setup-python/issues/948 + test_macos_latest: runs-on: macos-latest steps: - uses: actions/checkout@v4