Skip to content

Commit

Permalink
Merge pull request #777 from IanCa/develop
Browse files Browse the repository at this point in the history
Update to add 3.10/11 to tests
  • Loading branch information
VisLab authored Oct 13, 2023
2 parents 665b993 + 79f2d83 commit ced67c2
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
20 changes: 19 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,29 @@ on:
branches: ["*"]

jobs:
determine_version:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- id: set-matrix
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
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
fi
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 }}

Expand Down
2 changes: 1 addition & 1 deletion hed/models/base_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion tests/models/test_base_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit ced67c2

Please sign in to comment.