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

Report all issues rather than stop at first one. #450

Merged
merged 8 commits into from
Jul 10, 2024

Conversation

Kaniyaki
Copy link
Contributor

I created an empty list called "report". If constraints are satisfied, an error message is appended to the "report".
I updated all the conditions, and in the end, a dictionary is transformed into a string.
If that string is not empty, the error message is raised.
I used the "print" statement and "assert False" to check if errors are raised.

@janosg should I keep the "Invalid model specification:" message when the error is raised? All unit tests pass, so this should be good.

@Kaniyaki Kaniyaki requested a review from janosg March 29, 2023 11:07
@codecov
Copy link

codecov bot commented Mar 29, 2023

Codecov Report

Attention: Patch coverage is 98.00000% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/estimagic/parameters/check_constraints.py 93.75% 1 Missing ⚠️
Files with missing lines Coverage Δ
tests/parameters/test_check_constraints.py 100.00% <100.00%> (ø)
src/estimagic/parameters/check_constraints.py 87.96% <93.75%> (+12.00%) ⬆️

... and 1 file with indirect coverage changes

@janosg
Copy link
Member

janosg commented Mar 29, 2023

Hi @Kaniyaki, looks great.

I would replace "Invalid model specification" by "Violated constraint at start params". Estimagic is a very general library and not everything you optimize could be called a model.

Currently github action fails because test coverage over your changes is low. This is nothing you introduced, but could you fix it? I.e. call the function with invalid inputs and use with pytest.raises to make sure the correct error is raised?

Copy link
Member

@janosg janosg left a comment

Choose a reason for hiding this comment

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

Sorry that this got lost for so long. Great work!

@janosg janosg merged commit 5b97ca3 into main Jul 10, 2024
17 checks passed
@janosg janosg deleted the run-check_constraints_are_satisfied-beyond-first-failure branch July 10, 2024 07:52
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