Skip to content

Commit be20888

Browse files
committed
fix: resolve CI workflow issues
- Add ruff to dev dependencies - Fix package installation in all workflows - Add uv pip install -e . to install package in development mode - Fix ruff paths to use src/fisher_scoring/ instead of fisher_scoring/ - Remove unused variables flagged by ruff - All workflows now properly install and test the package Fixes: - ModuleNotFoundError: No module named 'fisher_scoring' - Failed to spawn: ruff (No such file or directory)
1 parent 888e9f3 commit be20888

9 files changed

Lines changed: 42 additions & 8 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ jobs:
3838
- name: Install dependencies
3939
run: |
4040
uv sync --dev
41+
uv pip install -e .
4142
4243
- name: Run tests
4344
run: |
@@ -70,14 +71,15 @@ jobs:
7071
- name: Install dependencies
7172
run: |
7273
uv sync --dev
74+
uv pip install -e .
7375
7476
- name: Run ruff
7577
run: |
76-
uv run ruff check fisher_scoring/ tests/
78+
uv run ruff check src/fisher_scoring/ tests/
7779
7880
- name: Run ruff format check
7981
run: |
80-
uv run ruff format --check fisher_scoring/ tests/
82+
uv run ruff format --check src/fisher_scoring/ tests/
8183
8284
type-check:
8385
runs-on: ubuntu-latest
@@ -97,9 +99,10 @@ jobs:
9799
- name: Install dependencies
98100
run: |
99101
uv sync --dev
102+
uv pip install -e .
100103
101104
- name: Run mypy (if configured)
102105
run: |
103106
# Add mypy configuration and uncomment when ready
104-
# uv run mypy fisher_scoring/
107+
# uv run mypy src/fisher_scoring/
105108
echo "Type checking skipped - configure mypy when ready"

.github/workflows/compatibility.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ jobs:
6262
uv add "scikit-learn"
6363
fi
6464
65+
- name: Install package in development mode
66+
run: |
67+
uv pip install -e .
68+
6569
- name: Run compatibility tests
6670
run: |
6771
echo "Testing Python ${{ matrix.python-version }} compatibility"

.github/workflows/release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ jobs:
3030
- name: Install dependencies
3131
run: |
3232
uv sync --dev
33+
uv pip install -e .
3334
3435
- name: Run tests
3536
run: |

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ dev = [
4141
"pytest-mock>=3.14.0,<4.0.0",
4242
"pydocstyle>=6.3.0,<7.0.0",
4343
"docformatter>=1.7.5,<2.0.0",
44+
"ruff>=0.1.0,<1.0.0",
4445
]
4546

4647
[tool.setuptools]

src/fisher_scoring/fisher_scoring_multinomial.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,6 @@ def predict_ci(self, X: np.ndarray, method: str = "logit") -> Dict[int, np.ndarr
344344

345345
ci_results = {}
346346
for class_idx in range(self.beta.shape[1]): # Iterate over each class
347-
beta_k = self.beta[:, class_idx]
348347
logits_k = logits[:, class_idx]
349348
probabilities_k = probabilities[:, class_idx]
350349

tests/test_fisher_scoring_focal.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def test_fit_predict_proba(self):
7373
def test_predict_ci(self):
7474
"""Test that predict_ci works correctly."""
7575
self.model.fit(self.X, self.y)
76-
ci_logit = self._predict_ci(
76+
self._predict_ci(
7777
"logit",
7878
"CI for logits should have shape (n_samples, 2).",
7979
"Lower CI should not exceed upper CI for logits.",

tests/test_fisher_scoring_logistic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def test_fit_predict_proba(self):
7070
def test_predict_ci(self):
7171
"""Test the predict_ci method for both logit and proba."""
7272
self.model.fit(self.X, self.y)
73-
ci_logit = self._predict_ci(
73+
self._predict_ci(
7474
"logit",
7575
"CI for logits should have shape (n_samples, 2).",
7676
"Lower CI should not exceed upper CI for logits.",

tests/test_fisher_scoring_poisson.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -425,8 +425,6 @@ def test_negative_binomial_information_matrix_comparison(self):
425425

426426
# Coefficients may differ significantly between expected and empirical methods
427427
# This is normal for count models where variance assumptions may not hold perfectly
428-
coeff_diff = np.linalg.norm(model_expected.weights - model_empirical.weights)
429-
430428
# Just verify that both methods produce reasonable results (not NaN/Inf)
431429
self.assertTrue(np.all(np.isfinite(model_expected.weights)))
432430
self.assertTrue(np.all(np.isfinite(model_empirical.weights)))

uv.lock

Lines changed: 28 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)