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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

Kaniyaki
Copy link
Collaborator

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 lines in your changes are missing coverage. Please review.

Project coverage is 93.08%. Comparing base (5574283) to head (e2eb7dc).

Files Patch % Lines
src/estimagic/parameters/check_constraints.py 93.75% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #450      +/-   ##
==========================================
+ Coverage   92.98%   93.08%   +0.09%     
==========================================
  Files         194      195       +1     
  Lines       14659    14697      +38     
==========================================
+ Hits        13631    13681      +50     
+ Misses       1028     1016      -12     

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

@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?

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.

None yet

3 participants