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

Adding the ConfigValidationError #281

Merged
merged 2 commits into from
Nov 6, 2024
Merged

Conversation

arik-shurygin
Copy link
Collaborator

This PR creates a new special class of error called the ConfigValidationError which wraps all our validation tests to return a special error message which is easier to understand rather than relying on simple AssertionErrors. This also means that critical errors to the config class itself are going to appear differently which could help with catching bugs.

I also added a brief test for the scenario in which a user identifies a STRAIN_IDX enum that is not equal in length to the number of strains they defined.

CLOSES #279

@arik-shurygin arik-shurygin requested a review from kokbent October 21, 2024 20:57
@arik-shurygin arik-shurygin changed the title Better config errors 279 Adding the ConfigValidationError Oct 21, 2024
(
val_func(key[0], vals[0])
if len(key)
== 1 # convert back to floats if needed
Copy link
Collaborator

Choose a reason for hiding this comment

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

seriously this line split is stupid thank you black :/

Copy link
Collaborator

@kokbent kokbent left a comment

Choose a reason for hiding this comment

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

Stamped

@arik-shurygin arik-shurygin merged commit 25b3c58 into main Nov 6, 2024
3 checks passed
@arik-shurygin arik-shurygin deleted the better-config-errors-279 branch November 6, 2024 16:56
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.

Better Config Errors
2 participants