From 06fd31686b861ceccefb7d0b32122c3ad54cd328 Mon Sep 17 00:00:00 2001 From: IanCa Date: Thu, 12 Oct 2023 15:56:50 -0500 Subject: [PATCH 1/7] Try bumping python version/restricting non master tests --- .github/workflows/ci.yaml | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 919e5c8f..8927786a 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -7,11 +7,26 @@ on: branches: ["*"] jobs: + determine_version: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.set-matrix.outputs.matrix }} + steps: + - id: set-matrix + run: | + if [[ "${{ github.ref }}" == 'refs/heads/master' ]]; then + echo "::set-output name=matrix::[3.7, 3.9, 3.10, 3.11]" + else + echo "::set-output name=matrix::[3.9]" + end + build: + needs: determine_version strategy: matrix: platform: [ubuntu-latest] - python-version: [3.7, 3.9] + python-version: ${{fromJson(needs.determine_version.outputs.matrix)}} + runs-on: ${{ matrix.platform }} From 8c844f9b03675d6b56e32584efca8dde875ec31c Mon Sep 17 00:00:00 2001 From: IanCa Date: Thu, 12 Oct 2023 15:59:27 -0500 Subject: [PATCH 2/7] Use correct loop end word --- .github/workflows/ci.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 8927786a..25625de2 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -18,7 +18,7 @@ jobs: echo "::set-output name=matrix::[3.7, 3.9, 3.10, 3.11]" else echo "::set-output name=matrix::[3.9]" - end + fi build: needs: determine_version @@ -27,7 +27,6 @@ jobs: platform: [ubuntu-latest] python-version: ${{fromJson(needs.determine_version.outputs.matrix)}} - runs-on: ${{ matrix.platform }} steps: From 97b834189fff6078a19f05ce7c28d38f1d403291 Mon Sep 17 00:00:00 2001 From: IanCa Date: Thu, 12 Oct 2023 16:03:44 -0500 Subject: [PATCH 3/7] Don't use semi-deprecated style --- .github/workflows/ci.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 25625de2..01a48a12 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -15,9 +15,9 @@ jobs: - id: set-matrix run: | if [[ "${{ github.ref }}" == 'refs/heads/master' ]]; then - echo "::set-output name=matrix::[3.7, 3.9, 3.10, 3.11]" + echo "matrix=[3.7, 3.9, 3.10, 3.11]" >> $GITHUB_OUTPUT else - echo "::set-output name=matrix::[3.9]" + echo "matrix=[3.9]" >> $GITHUB_OUTPUT fi build: From 3fe606be962145b3cdb477092adf79ffc040b25b Mon Sep 17 00:00:00 2001 From: IanCa Date: Thu, 12 Oct 2023 16:13:19 -0500 Subject: [PATCH 4/7] Try to detect master differently --- .github/workflows/ci.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 01a48a12..25f09d8b 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -14,7 +14,11 @@ jobs: steps: - id: set-matrix run: | - if [[ "${{ github.ref }}" == 'refs/heads/master' ]]; then + if [[ "${{ github.event_name }}" == 'push' && "${{ github.ref }}" == 'refs/heads/master' ]]; then + # Push to master branch + echo "matrix=[3.7, 3.9, 3.10, 3.11]" >> $GITHUB_OUTPUT + elif [[ "${{ github.event_name }}" == 'pull_request' && "${{ github.event.pull_request.base.ref }}" == 'master' ]]; then + # PR to master branch echo "matrix=[3.7, 3.9, 3.10, 3.11]" >> $GITHUB_OUTPUT else echo "matrix=[3.9]" >> $GITHUB_OUTPUT From 39c7487d2c7e5ea3453232daeb52839c69378368 Mon Sep 17 00:00:00 2001 From: IanCa Date: Thu, 12 Oct 2023 16:19:34 -0500 Subject: [PATCH 5/7] don't treat 3.10 as 3.1 --- .github/workflows/ci.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 25f09d8b..ea78321f 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -16,12 +16,12 @@ jobs: run: | if [[ "${{ github.event_name }}" == 'push' && "${{ github.ref }}" == 'refs/heads/master' ]]; then # Push to master branch - echo "matrix=[3.7, 3.9, 3.10, 3.11]" >> $GITHUB_OUTPUT + echo 'matrix=["3.7", "3.9", "3.10", "3.11"]' >> $GITHUB_OUTPUT elif [[ "${{ github.event_name }}" == 'pull_request' && "${{ github.event.pull_request.base.ref }}" == 'master' ]]; then # PR to master branch - echo "matrix=[3.7, 3.9, 3.10, 3.11]" >> $GITHUB_OUTPUT + echo 'matrix=["3.7", "3.9", "3.10", "3.11"]' >> $GITHUB_OUTPUT else - echo "matrix=[3.9]" >> $GITHUB_OUTPUT + echo 'matrix=["3.9"]' >> $GITHUB_OUTPUT fi build: From a762ba76a490a17f511cd90c79a7da9267fae912 Mon Sep 17 00:00:00 2001 From: IanCa Date: Thu, 12 Oct 2023 18:35:51 -0500 Subject: [PATCH 6/7] Maybe supress warning in 3.7 code --- hed/models/base_input.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hed/models/base_input.py b/hed/models/base_input.py index 9f437102..58bb94c9 100644 --- a/hed/models/base_input.py +++ b/hed/models/base_input.py @@ -137,7 +137,7 @@ def _indexed_dict_from_onsets(onsets): @staticmethod def _filter_by_index_list(original_series, indexed_dict): - new_series = pd.Series(["n/a"] * len(original_series)) + new_series = pd.Series(["n/a"] * len(original_series), dtype=str) for onset, indices in indexed_dict.items(): if indices: From 79f2d83f053fa0a6eb28cf62be3c7a50c360d229 Mon Sep 17 00:00:00 2001 From: IanCa Date: Thu, 12 Oct 2023 18:45:01 -0500 Subject: [PATCH 7/7] fix test case maybe --- tests/models/test_base_input.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/models/test_base_input.py b/tests/models/test_base_input.py index 71e21386..02c7f34a 100644 --- a/tests/models/test_base_input.py +++ b/tests/models/test_base_input.py @@ -304,7 +304,7 @@ def test_complex_onsets(self): {3.5: [0, 1], 4.0: [2], 4.4: [3, 4], -1.0: [5]}) def test_empty_and_single_item_series(self): - self.assertTrue(BaseInput._filter_by_index_list(pd.Series([]), {}).equals(pd.Series([]))) + self.assertTrue(BaseInput._filter_by_index_list(pd.Series([], dtype=str), {}).equals(pd.Series([], dtype=str))) self.assertTrue(BaseInput._filter_by_index_list(pd.Series(["apple"]), {0: [0]}).equals(pd.Series(["apple"]))) def test_two_item_series_with_same_onset(self):