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
23 changes: 21 additions & 2 deletions .github/workflows/acceptable_memory_usage_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,39 @@ env:
FORCE_COLOR: "1"

jobs:
# This logic is based on the discussion here (and the links within):
# https://github.com/orgs/community/discussions/27128
#
check_for_new_commits:
name: Check for commits in the last 24 hours
runs-on: ubuntu-latest
outputs:
num_new_commits: ${{ steps.count_new_commits.outputs.num_new_commits }}
steps:
- uses: actions/checkout@v6

- id: count_new_commits
run: echo "num_new_commits=$(git log --oneline --since '24 hours ago' | wc -l)" >> "$GITHUB_OUTPUT"


run:
name: Python ${{ matrix.python-version }} Performance Tests
runs-on: ${{ matrix.os }}

needs: check_for_new_commits
if: ${{ github.event_name == 'workflow_dispatch' || needs.check_for_new_commits.outputs.num_new_commits > 0 }}

strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ["3.11", "3.12", "3.13"]

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_and_publish_gem.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
sudo apt install -y ruby

- name: Checkout code from repo
uses: actions/checkout@v4
uses: actions/checkout@v6

- name: Build the Ruby package
run: |
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ jobs:
python-version: ["3.11", "3.12", "3.13"]

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}

Expand All @@ -48,7 +48,7 @@ jobs:
run: uv run pytest --junitxml=pytest.xml

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
uses: codecov/codecov-action@v6
with:
token: ${{ secrets.CODECOV_TOKEN }}

Expand All @@ -60,6 +60,7 @@ jobs:

- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/test-results-action@v1
uses: codecov/codecov-action@v6
with:
token: ${{ secrets.CODECOV_TOKEN }}
report_type: test_results
9 changes: 7 additions & 2 deletions tests/acceptable_memory_usage_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,15 @@ def test_acceptable_memory_usage():
allele_1: HLAStandard = hla_alg.hla_standards["B"]["B*07:02:01G"]
allele_2: HLAStandard = hla_alg.hla_standards["B"]["B*45:01:01G"]

# "Mush" together the two sequences by doing a bitwise or of the binary
# sequences.
exon2_bin: np.ndarray = np.array(allele_1.two) | np.array(allele_2.two)
exon3_bin: np.ndarray = np.array(allele_1.three) | np.array(allele_2.three)

expensive_sequence = HLASequence(
two=(int(s) for s in np.array(allele_1.two) | np.array(allele_2.two)),
two=tuple(int(s) for s in exon2_bin),
intron=(),
three=(int(s) for s in np.array(allele_1.three) | np.array(allele_2.three)),
three=tuple(int(s) for s in exon3_bin),
name="expensive_sequence",
locus="B",
)
Expand Down
Loading