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

Replacing assert statements with Exceptions #137

Merged
merged 21 commits into from
Dec 4, 2023

Conversation

jezsadler
Copy link
Collaborator

Replaced assert statements across several files with ValueError or TypeError messages, which should be more informative.

Included unit tests for many of these - some of the error states were difficult to induce.

Legal Acknowledgement
By contributing to this software project, I agree my contributions are submitted under the BSD license.
I represent I am authorized to make the contributions and grant the license.
If my employer has rights to intellectual property that includes these contributions,
I represent that I have received permission to make contributions and grant the required license on behalf of that employer.

Copy link

codecov bot commented Nov 6, 2023

Codecov Report

Attention: 78 lines in your changes are missing coverage. Please review.

Comparison is base (b9600e2) 95.95% compared to head (4a83a22) 91.89%.

❗ Current head 4a83a22 differs from pull request most recent head 7d660c4. Consider uploading reports for the commit 7d660c4 to get more accurate results

Files Patch % Lines
src/omlt/io/onnx_parser.py 45.94% 20 Missing and 20 partials ⚠️
src/omlt/neuralnet/layer.py 60.97% 10 Missing and 6 partials ⚠️
src/omlt/gbt/model.py 20.00% 5 Missing and 3 partials ⚠️
src/omlt/neuralnet/nn_formulation.py 66.66% 4 Missing and 4 partials ⚠️
src/omlt/gbt/gbt_formulation.py 0.00% 3 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #137      +/-   ##
==========================================
- Coverage   95.95%   91.89%   -4.06%     
==========================================
  Files          29       29              
  Lines        1656     1752      +96     
  Branches      255      330      +75     
==========================================
+ Hits         1589     1610      +21     
- Misses         35       76      +41     
- Partials       32       66      +34     

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

Copy link
Member

@rmisener rmisener left a comment

Choose a reason for hiding this comment

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

Thanks so much @jezsadler for these super useful changes. I'm going to give the team one last chance to object during the call today and then merge this.

@rmisener rmisener merged commit b43ac5e into cog-imperial:main Dec 4, 2023
6 of 8 checks passed
@rmisener rmisener mentioned this pull request Dec 4, 2023
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