Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix type stability in autocov and add a unit test #270

Merged
merged 2 commits into from
Nov 27, 2023

Conversation

vandenman
Copy link
Contributor

@vandenman vandenman commented Nov 27, 2023

Fixes #269

I tried to make the test a bit less copy-pasta with

for property in (:cross, :m1, :m2, :lag, :wlag, :v)
    @eval begin
        @test (@inferred ((o) -> o.property)(o)) === o.property
    end
end

but unfortunately, that doesn't work since @eval always works in global scope, so I just copy-pasted it.

You can test that this solves the issue with _fit! by running:

@code_warntype OnlineStats._fit!(AutoCov(10), randn(100))

Suggestions, comments, and feedback are welcome!

Copy link

codecov bot commented Nov 27, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (7813dc2) 68.47% compared to head (842d085) 68.01%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #270      +/-   ##
==========================================
- Coverage   68.47%   68.01%   -0.46%     
==========================================
  Files          21       21              
  Lines        1973     1973              
==========================================
- Hits         1351     1342       -9     
- Misses        622      631       +9     

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

@joshday joshday merged commit e5052bc into joshday:master Nov 27, 2023
7 of 8 checks passed
@vandenman vandenman deleted the typestable_AutoCov branch November 27, 2023 15:44
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.

_fit! on AutoCov is not type stable
2 participants