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 missing check for infer function #228

Merged
merged 4 commits into from
Feb 23, 2024
Merged

Fix missing check for infer function #228

merged 4 commits into from
Feb 23, 2024

Conversation

albertpod
Copy link
Member

We have noticed a missing check for the data in the infer function.
Fixed now. Added a few more tests.

@albertpod albertpod requested a review from bvdmitri February 21, 2024 12:34
Copy link

codecov bot commented Feb 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.32%. Comparing base (09e657f) to head (9cd0d84).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #228      +/-   ##
==========================================
+ Coverage   80.31%   80.32%   +0.01%     
==========================================
  Files          11       11              
  Lines        1290     1291       +1     
==========================================
+ Hits         1036     1037       +1     
  Misses        254      254              

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

observations = [[1.0; zeros(5)], [zeros(5); 1.0]]

@testset "Test misspecified data" begin
@test_throws ErrorException infer(model = rolling_die(2), data = (y = observations))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These tests don't really test that the output error is user friendly. It will error of course anyway no matter the changes in the PR. I suggest to use

@test_throws "part of the error message" infer(...)

See example here

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@bvdmitri bvdmitri merged commit 495baa7 into main Feb 23, 2024
7 checks passed
@bvdmitri bvdmitri deleted the fix_infer_dicttype branch February 23, 2024 08:54
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.

2 participants