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: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/task-issue-template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Task issue template
about: The actionable task template.
title: ''
labels: task
assignees: ''

---

## Goal
What are we trying to achieve?

## Proposed approach
(brief, not perfect)

## Scope
What files/modules are affected?

## Done when
Clear condition for completion
3 changes: 2 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, Windows-latest, macos-latest]
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
runs-on: ${{ matrix.os }}
permissions:
contents: read
Expand Down Expand Up @@ -36,7 +37,7 @@ jobs:
run: python3 -m build

- name: Install AlphaImpute2
run: pip install dist/alphaimpute2-0.0.3-py3-none-any.whl
run: pip install dist/alphaimpute2-0.0.4-py3-none-any.whl

- name: Install pytest
run: |
Expand Down
34 changes: 26 additions & 8 deletions conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import operator
import os
import shutil
import warnings
import numpy as np


Expand Down Expand Up @@ -50,13 +51,22 @@ def pytest_runtest_makereport():
num_file = 3
else:
num_file = 2
accu = stdout[-1][-1].split("\n")[-(2 + 3 * num_file) :]
name = accu[0].split()[-1]
with open("tests/accuracy_tests/accu_report.txt", "a") as file:
for i in range(num_file):
assessed_file = accu[i * 3 + 1].split()[-1]
file.write(name + " " + assessed_file + " " + accu[i * 3 + 2] + "\n")
file.write(name + " " + assessed_file + " " + accu[i * 3 + 3] + "\n")
try:
accu = stdout[-1][-1].split("\n")[-(2 + 3 * num_file) :]
name = accu[0].split()[-1]
with open("tests/accuracy_tests/accu_report.txt", "a") as file:
for i in range(num_file):
assessed_file = accu[i * 3 + 1].split()[-1]
file.write(
name + " " + assessed_file + " " + accu[i * 3 + 2] + "\n"
)
file.write(
name + " " + assessed_file + " " + accu[i * 3 + 3] + "\n"
)
except IndexError:
warnings.warn(
"Some outputs may be missing for the generation for the accuracy report. You can check tests/accuracy_tests/accu_report.txt for the recorded accuracies or rerun the tests. "
)


@pytest.hookimpl()
Expand Down Expand Up @@ -88,7 +98,15 @@ def pytest_terminal_summary(terminalreporter):
"Gen5 Accu",
)
dt = {"names": columns, "formats": ("U76", "U28", "U25") + ("f4",) * (nGen + 1)}
accu = np.loadtxt("tests/accuracy_tests/accu_report.txt", encoding=None, dtype=dt)
try:
accu = np.loadtxt(
"tests/accuracy_tests/accu_report.txt", encoding=None, dtype=dt
)
except ValueError:
warnings.warn(
"Some outputs may be missing for the generation for the accuracy report. You can check tests/accuracy_tests/accu_report.txt for the recorded accuracies or rerun the tests. "
)
return

mkr_accu = list(
filter(
Expand Down
Loading
Loading