Skip to content

Add validation so that parameters cannot be NaN#173

Merged
guilhermebodin merged 5 commits intomasterfrom
gb/cannot-have-nan-parameter
Apr 3, 2025
Merged

Add validation so that parameters cannot be NaN#173
guilhermebodin merged 5 commits intomasterfrom
gb/cannot-have-nan-parameter

Conversation

@guilhermebodin
Copy link
Copy Markdown
Collaborator

No description provided.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 3, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.58%. Comparing base (ab4da45) to head (055c807).
Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #173      +/-   ##
==========================================
+ Coverage   95.80%   96.58%   +0.78%     
==========================================
  Files           5        5              
  Lines        1097     1114      +17     
==========================================
+ Hits         1051     1076      +25     
+ Misses         46       38       -8     

☔ 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.

Comment thread src/MOI_wrapper.jl Outdated
end

function _assert_parameter_is_not_nan(set::MOI.Parameter{T}) where {T}
if isnan(set.value)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Lets switch to "isfinite" that checks both NaN and Inf?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I was wondering if Inf was a valid parameter. But ok I will change it

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I was thinking the same, but since JuMP blocks this, we should block as well

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

is someone shows up with a use case, we can review

Comment thread src/MOI_wrapper.jl Outdated
@guilhermebodin guilhermebodin merged commit 049737b into master Apr 3, 2025
8 checks passed
@guilhermebodin guilhermebodin deleted the gb/cannot-have-nan-parameter branch April 3, 2025 20:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants