Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 88 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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)

Expand All @@ -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)

Expand All @@ -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:
Expand Down Expand Up @@ -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 }}
2 changes: 1 addition & 1 deletion SUPPORTED_INSTRUMENT_SOFTWARE.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/allotropy/parsers/bmg_mars/bmg_mars_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
4 changes: 2 additions & 2 deletions tests/parsers/bmg_mars/testdata/BMG Labtech format.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
Loading