Merged
Conversation
Prettify linter output in case of schema violations in the problem yaml file. Previously, the messages were rather confusing.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #401 +/- ##
===========================================
- Coverage 73.97% 73.80% -0.18%
===========================================
Files 58 58
Lines 6489 6504 +15
Branches 1120 1122 +2
===========================================
Hits 4800 4800
- Misses 1264 1279 +15
Partials 425 425 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
dilpath
approved these changes
Jul 3, 2025
Comment on lines
+165
to
+168
| path = list(e.absolute_path) | ||
| path = ( | ||
| path[0] + "".join(f"[{str(p)}]" for p in path[1:]) + ": " | ||
| ) |
Member
There was a problem hiding this comment.
Is path[0] always a string, even if there is a validation error?
This would be enough for me, but fine as is.
Suggested change
| path = list(e.absolute_path) | |
| path = ( | |
| path[0] + "".join(f"[{str(p)}]" for p in path[1:]) + ": " | |
| ) | |
| path = "/".join(map(str, e.absolute_path)) + ": " |
Member
Author
There was a problem hiding this comment.
Is
path[0]always a string, even if there is a validation error?
Hm, if the yaml file is really completely off, it may not be. Will add `str'.
Regarding paths, I prefer the [] notation, which feels more natural to me in the dict/yaml context.
petab/petablint.py
Outdated
Comment on lines
+169
to
+170
| else: | ||
| path = "" |
petab/petablint.py
Outdated
Comment on lines
+172
to
+173
| "Provided YAML file does not adhere to PEtab schema: " | ||
| f"{path}{e.args[0]}" |
Member
There was a problem hiding this comment.
Suggested change
| "Provided YAML file does not adhere to PEtab schema: " | |
| f"{path}{e.args[0]}" | |
| "Provided YAML file does not adhere to PEtab schema. At " | |
| f"{path}{e.args[0]}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Prettify linter output in case of schema violations in the problem yaml file. Previously, the messages were rather confusing.
Also fix an error message and a bug in the default schema choice.
Related to #369.