diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2b6fbaec6..00ca4af21 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,7 +12,68 @@ permissions: contents: read jobs: + detect-changes: + runs-on: ubuntu-latest + outputs: + single-parser: ${{ steps.detect-parser.outputs.parser }} + run-all-tests: ${{ steps.detect-parser.outputs.run-all }} + steps: + - uses: actions/checkout@v4 + - uses: dorny/paths-filter@v3 + id: filter + with: + list-files: json + filters: | + parsers: + - 'src/allotropy/parsers/**' + non-parser: + - 'src/allotropy/!(parsers)/**' + - 'tests/!(parsers)/**' + - 'pyproject.toml' + - 'scripts/**' + - '.github/**' + - name: Detect single parser changes + id: detect-parser + run: | + if [[ "${{ steps.filter.outputs.non-parser }}" == "true" ]]; then + echo "Changes detected outside parsers, running all tests" + echo "run-all=true" >> $GITHUB_OUTPUT + echo "parser=" >> $GITHUB_OUTPUT + elif [[ "${{ steps.filter.outputs.parsers }}" == "true" ]]; then + # Get list of changed files in parsers directory + FILES=$(echo '${{ steps.filter.outputs.parsers_files }}' | jq -r '.[]') + + # Extract unique parser directories + PARSERS=$(echo "$FILES" | grep '^src/allotropy/parsers/' | cut -d'/' -f4 | sort -u) + + # Count unique parsers + PARSER_COUNT=$(echo "$PARSERS" | grep -v '^$' | wc -l) + + if [[ $PARSER_COUNT -eq 1 ]]; then + PARSER=$(echo "$PARSERS" | head -n1) + # Check if it's actually a parser directory (not utils, shared, etc) + if [[ "$PARSER" != "utils" && "$PARSER" != "__pycache__" && -d "tests/parsers/$PARSER" ]]; then + echo "Single parser detected: $PARSER" + echo "run-all=false" >> $GITHUB_OUTPUT + echo "parser=$PARSER" >> $GITHUB_OUTPUT + else + echo "Changes in shared parser utilities, running all tests" + echo "run-all=true" >> $GITHUB_OUTPUT + echo "parser=" >> $GITHUB_OUTPUT + fi + else + echo "Multiple parsers changed, running all tests" + echo "run-all=true" >> $GITHUB_OUTPUT + echo "parser=" >> $GITHUB_OUTPUT + fi + else + echo "No parser changes detected, running all tests" + echo "run-all=true" >> $GITHUB_OUTPUT + echo "parser=" >> $GITHUB_OUTPUT + fi + test_py_310: + needs: detect-changes runs-on: ubuntu-latest name: Tests (python 3.10) @@ -28,10 +89,18 @@ jobs: - name: Install click run: pip install click!=8.3.0 - name: Run Tests - run: hatch run test_all.py3.10:pytest -n 2 tests + run: | + if [[ "${{ needs.detect-changes.outputs.run-all }}" == "true" ]]; then + echo "Running all tests" + hatch run test_all.py3.10:pytest -n 2 tests + else + echo "Running tests for parser: ${{ needs.detect-changes.outputs.single-parser }}" + hatch run test_all.py3.10:pytest -n 2 tests/parsers/${{ needs.detect-changes.outputs.single-parser }} + fi timeout-minutes: 15 test_py_311: + needs: detect-changes runs-on: ubuntu-latest name: Tests (python 3.11) @@ -48,10 +117,18 @@ jobs: - name: Install click run: pip install click!=8.3.0 - name: Run Tests - run: hatch run test_all.py3.11:pytest -n 2 tests + run: | + if [[ "${{ needs.detect-changes.outputs.run-all }}" == "true" ]]; then + echo "Running all tests" + hatch run test_all.py3.11:pytest -n 2 tests + else + echo "Running tests for parser: ${{ needs.detect-changes.outputs.single-parser }}" + hatch run test_all.py3.11:pytest -n 2 tests/parsers/${{ needs.detect-changes.outputs.single-parser }} + fi timeout-minutes: 15 test_py_312: + needs: detect-changes runs-on: ubuntu-latest name: Tests (python 3.12) @@ -67,7 +144,14 @@ jobs: - name: Install click run: pip install click!=8.3.0 - name: Run Tests - run: hatch run test_all.py3.12:pytest -n 2 tests + run: | + if [[ "${{ needs.detect-changes.outputs.run-all }}" == "true" ]]; then + echo "Running all tests" + hatch run test_all.py3.12:pytest -n 2 tests + else + echo "Running tests for parser: ${{ needs.detect-changes.outputs.single-parser }}" + hatch run test_all.py3.12:pytest -n 2 tests/parsers/${{ needs.detect-changes.outputs.single-parser }} + fi timeout-minutes: 15 lint: @@ -99,4 +183,4 @@ jobs: - name: Check PR title run: ./scripts/check_title env: - PR_TITLE: ${{ github.event.pull_request.title }} + PR_TITLE: ${{ github.event.pull_request.title }} \ No newline at end of file diff --git a/SUPPORTED_INSTRUMENT_SOFTWARE.adoc b/SUPPORTED_INSTRUMENT_SOFTWARE.adoc index fda894056..c985fe2ef 100644 --- a/SUPPORTED_INSTRUMENT_SOFTWARE.adoc +++ b/SUPPORTED_INSTRUMENT_SOFTWARE.adoc @@ -39,7 +39,7 @@ The parsers follow maturation levels of: Recommended, Candidate Release, Working .14+|Plate Reader|Agilent Gen5|Recommended|REC/2025/03 |Agilent Gen5 Image|Recommended|BENCHLING/2023/09 |BMG Labtech SMART Control|Recommended|REC/2024/06 -|BMG Labtech MARS|Recommended|REC/2024/06 +|BMG Labtech MAR|Recommended|REC/2024/06 |CTL ImmunoSpot|Recommended|BENCHLING/2023/09 |Mabtech Apex|Recommended|BENCHLING/2023/09 |MSD Methodical Mind|Recommended|REC/2024/06 diff --git a/src/allotropy/parsers/bmg_mars/bmg_mars_parser.py b/src/allotropy/parsers/bmg_mars/bmg_mars_parser.py index b36817ef9..1d1486fc7 100644 --- a/src/allotropy/parsers/bmg_mars/bmg_mars_parser.py +++ b/src/allotropy/parsers/bmg_mars/bmg_mars_parser.py @@ -19,7 +19,7 @@ class BmgMarsParser(VendorParser[Data, Model]): - DISPLAY_NAME = "BMG Labtech MARS" + DISPLAY_NAME = "BMG Labtech MAR" RELEASE_STATE = ReleaseState.RECOMMENDED SUPPORTED_EXTENSIONS = "csv" SCHEMA_MAPPER = Mapper diff --git a/tests/parsers/bmg_mars/testdata/16-02-29 14-34-46 Transcreener ADP2 FI.json b/tests/parsers/bmg_mars/testdata/16-02-29 14-34-46 Transcreener ADP2 FI.json index e96417091..a10a81cc1 100644 --- a/tests/parsers/bmg_mars/testdata/16-02-29 14-34-46 Transcreener ADP2 FI.json +++ b/tests/parsers/bmg_mars/testdata/16-02-29 14-34-46 Transcreener ADP2 FI.json @@ -13900,8 +13900,8 @@ "data system instance identifier": "N/A", "file name": "16-02-29 14-34-46 Transcreener ADP2 FI.csv", "UNC path": "C:\\Program Files (x86)\\BMG\\PHERAstar\\User\\Data", - "ASM converter name": "allotropy_bmg_labtech_mars", - "ASM converter version": "0.1.105", + "ASM converter name": "allotropy_bmg_labtech_mar", + "ASM converter version": "0.1.113", "software name": "BMG MARS" }, "device system document": { diff --git a/tests/parsers/bmg_mars/testdata/16-03-03 13-25-45 472 QC 384 FI.json b/tests/parsers/bmg_mars/testdata/16-03-03 13-25-45 472 QC 384 FI.json index 2ed35de36..95afca1c0 100644 --- a/tests/parsers/bmg_mars/testdata/16-03-03 13-25-45 472 QC 384 FI.json +++ b/tests/parsers/bmg_mars/testdata/16-03-03 13-25-45 472 QC 384 FI.json @@ -3068,8 +3068,8 @@ "data system instance identifier": "N/A", "file name": "16-03-03 13-25-45 472 QC 384 FI.csv", "UNC path": "C:\\Program Files (x86)\\BMG\\PHERAstar\\User\\Data", - "ASM converter name": "allotropy_bmg_labtech_mars", - "ASM converter version": "0.1.105", + "ASM converter name": "allotropy_bmg_labtech_mar", + "ASM converter version": "0.1.113", "software name": "BMG MARS" }, "device system document": { diff --git a/tests/parsers/bmg_mars/testdata/16-03-03 16-54-03 472 ABS 384 QC.json b/tests/parsers/bmg_mars/testdata/16-03-03 16-54-03 472 ABS 384 QC.json index 47e71cb2c..10a3f5f7c 100644 --- a/tests/parsers/bmg_mars/testdata/16-03-03 16-54-03 472 ABS 384 QC.json +++ b/tests/parsers/bmg_mars/testdata/16-03-03 16-54-03 472 ABS 384 QC.json @@ -4067,8 +4067,8 @@ "data system instance identifier": "N/A", "file name": "16-03-03 16-54-03 472 ABS 384 QC.csv", "UNC path": "C:\\Program Files (x86)\\BMG\\PHERAstar\\User\\Data", - "ASM converter name": "allotropy_bmg_labtech_mars", - "ASM converter version": "0.1.105", + "ASM converter name": "allotropy_bmg_labtech_mar", + "ASM converter version": "0.1.113", "software name": "BMG MARS" }, "device system document": { diff --git a/tests/parsers/bmg_mars/testdata/24-10-16 15-09-52 Luminescence 1536.json b/tests/parsers/bmg_mars/testdata/24-10-16 15-09-52 Luminescence 1536.json index 0e1fe5c7a..358306786 100644 --- a/tests/parsers/bmg_mars/testdata/24-10-16 15-09-52 Luminescence 1536.json +++ b/tests/parsers/bmg_mars/testdata/24-10-16 15-09-52 Luminescence 1536.json @@ -56840,8 +56840,8 @@ "data system instance identifier": "N/A", "file name": "24-10-16 15-09-52 Luminescence 1536.csv", "UNC path": "C:\\Program Files (x86)\\BMG\\CLARIOstar\\User\\Data", - "ASM converter name": "allotropy_bmg_labtech_mars", - "ASM converter version": "0.1.105", + "ASM converter name": "allotropy_bmg_labtech_mar", + "ASM converter version": "0.1.113", "software name": "BMG MARS" }, "device system document": { diff --git a/tests/parsers/bmg_mars/testdata/BMG Labtech format.json b/tests/parsers/bmg_mars/testdata/BMG Labtech format.json index ea8fd1d1f..e18f263e9 100644 --- a/tests/parsers/bmg_mars/testdata/BMG Labtech format.json +++ b/tests/parsers/bmg_mars/testdata/BMG Labtech format.json @@ -4040,8 +4040,8 @@ "data system instance identifier": "N/A", "file name": "BMG Labtech format.CSV", "UNC path": "C:\\Users\\Lab user\\Documents\\Discovery\\Data", - "ASM converter name": "allotropy_bmg_labtech_mars", - "ASM converter version": "0.1.111", + "ASM converter name": "allotropy_bmg_labtech_mar", + "ASM converter version": "0.1.113", "software name": "BMG MARS" }, "device system document": { diff --git a/tests/parsers/bmg_mars/testdata/MARS V3.40 V2 Output Missing line end separators.json b/tests/parsers/bmg_mars/testdata/MARS V3.40 V2 Output Missing line end separators.json index 206cf87c7..49e976098 100644 --- a/tests/parsers/bmg_mars/testdata/MARS V3.40 V2 Output Missing line end separators.json +++ b/tests/parsers/bmg_mars/testdata/MARS V3.40 V2 Output Missing line end separators.json @@ -13900,8 +13900,8 @@ "data system instance identifier": "N/A", "file name": "MARS V3.40 V2 Output Missing line end separators.csv", "UNC path": "C:\\Program Files (x86)\\BMG\\PHERAstar\\User\\Data", - "ASM converter name": "allotropy_bmg_labtech_mars", - "ASM converter version": "0.1.105", + "ASM converter name": "allotropy_bmg_labtech_mar", + "ASM converter version": "0.1.113", "software name": "BMG MARS" }, "device system document": {