Skip to content

Conversation

@nalimilan
Copy link
Member

@nalimilan nalimilan commented Dec 22, 2025

List all arguments for all fit methods (lm, glm, fit(LinearModel, ...) and fit(GeneralizedLinearModel, ...) so that users get more friendly errors about the function they called when they make mistakes. This matters especially given the large number of arguments which makes an error likely. This requires some refactoring, notably using nothing as a default value instead of vector in the matrix method to match the formula method.

Also improve docs: describe keyword arguments in all docstrings instead of referring to fit, avoid repeating them in signature.

In the process I found a bug where weights were ignored by negbin. New tested values match R up to three decimals (this is tested more thoroughly via glm tests).

@nalimilan nalimilan changed the title Cleanup fit method arguments Cleanup fit method arguments Dec 22, 2025
This was referenced Dec 22, 2025
@nalimilan nalimilan changed the base branch from pr487 to master December 23, 2025 17:20
List all arguments for all fit methods (`lm`, `glm`, `fit(LinearModel, ...)`
and `fit(GeneralizedLinearModel, ...)` so that users get more friendly errors
about the function they called when they make mistakes. This matters especially
given the large number of arguments which makes an error likely. This requires
some refactoring, notably using `nothing` as a default value instead of vector
in the matrix method to match the formula method.

Also improve docs: describe keyword arguments in all docstrings instead of referring
to `fit`, avoid repeating them in signature.

In the process I found a bug where weights were ignored by `negbin`. New tested
values match R up to three decimals (this is tested more thoroughly via `glm` tests).
@codecov
Copy link

codecov bot commented Dec 23, 2025

Codecov Report

❌ Patch coverage is 86.36364% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 96.93%. Comparing base (e26c5d5) to head (cf91b24).

Files with missing lines Patch % Lines
src/negbinfit.jl 77.77% 2 Missing ⚠️
src/glmfit.jl 88.88% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #622      +/-   ##
==========================================
- Coverage   96.98%   96.93%   -0.06%     
==========================================
  Files           8        8              
  Lines        1196     1206      +10     
==========================================
+ Hits         1160     1169       +9     
- Misses         36       37       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@nalimilan nalimilan merged commit 25cbf29 into master Dec 29, 2025
9 of 11 checks passed
@nalimilan nalimilan deleted the nl/args branch December 29, 2025 10:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants