Skip to content
Merged
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
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