-
Notifications
You must be signed in to change notification settings - Fork 23
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
Add json schema validation for source data at the interface level #1090
Conversation
This is ready. Three things:
|
@@ -23,7 +23,7 @@ Convert LightningPose pose estimation data to NWB using :py:class:`~neuroconv.da | |||
>>> labeled_video_file_path = str(folder_path / "labeled_videos/test_vid_labeled.mp4") | |||
|
|||
>>> converter = LightningPoseConverter(file_path=file_path, original_video_file_path=original_video_file_path, labeled_video_file_path=labeled_video_file_path, verbose=False) | |||
|
|||
Source data is valid! |
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.
Here I was thinking you despised verbosity in the testing suite 😉
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.
I do, but I did not want to change there because I saw that @pauladkisson explicitly set verbose=True
so I went with what I assumed was the intent.
I too am surprised by this, but maybe not so much -
Nice - yeah that has always proved a subtle pain point, since we do utilize additional
Good catches - accurate validation must rely on accurate annotations, which have only ever been used so far as a form of developer communication |
Just beware, this (like the Pydantic one before it) could potentially break custom conversion pipelines using latest/dev NeuroConv by requiring them to use accurate annotations on all interface |
This is a very important point. Just to be clear: if they were using neuroconv/src/neuroconv/nwbconverter.py Lines 45 to 85 in f284105
|
I suppose that's true, but I've been guilty myself of using ConverterPipes sometimes What is mildly annoying now is that JSON validation occurs in both NWBConverter initialization and individual interface initialization, but overall benefit is probably worth it in the end |
Agree with it, I would think long term on how to avoid the overlap. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1090 +/- ##
==========================================
+ Coverage 90.44% 90.57% +0.12%
==========================================
Files 129 129
Lines 8055 8155 +100
==========================================
+ Hits 7285 7386 +101
+ Misses 770 769 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Should close #42.