-
Notifications
You must be signed in to change notification settings - Fork 15
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
Lowlevel helpers clean up #1410
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main-dev #1410 +/- ##
============================================
+ Coverage 78.32% 78.35% +0.03%
============================================
Files 137 137
Lines 20910 20885 -25
============================================
- Hits 16378 16365 -13
+ Misses 4532 4520 -12
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
pyaerocom/aeroval/aux_io_helpers.py
Outdated
funcs: dict[str, Callable] | ||
|
||
@model_validator(mode="after") | ||
def validate_fun(self) -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Return type should be _AuxReadSpec
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can return Self
pyaerocom/aeroval/aux_io_helpers.py
Outdated
elif isinstance(fun, str): | ||
return funcs[fun] | ||
raise ValueError("failed to retrieve aux func") | ||
fun: str | Callable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to use something like this to make fun
typehint as str only during typechecking, since that's what we expect it to be after validation? I think this would work better with tools such as mypy and code autocompletion.
Change Summary
_AuxReadSpec
in terms of pydanticValidator
child classesStrWithDefault
,FlexList
,EitherOf
,ListOfStrings
Related issue number
N/A
Checklist