-
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
Make config_file_path
optional on DeepLabCutInterface
#1031
Conversation
Can you add a small test case with the existing example data really quick? |
What kind of test are you envisioning? That it does not fail when you pass None instead of a file_path? |
A showcase of w/e new behavior you are adding in this PR insofar as it is different from the current test cases |
The new behavior is that you don't require to pass a configuration file path. Would the test I mentioned cover it? |
Possibly - unless there is logic in DLC interface for 'searching' for a nearby config, in which case you'd have to making a tmpdir copy of example data w/o the config file |
There is no such a thing. |
This was a good suggestion @CodyCBakerPhD. I found out another nested use of the configuration file deep inside the call stack of the utils. |
Will need this: |
…quierement_in_dlc' into drop_config_file_requierement_in_dlc
expected_pose_estimation_series = ["ind1_leftear", "ind1_rightear", "ind1_snout", "ind1_tailbase"] | ||
|
||
expected_pose_estimation_series_are_in_nwb_file = [ | ||
pose_estimation in pose_estimation_series_in_nwb for pose_estimation in expected_pose_estimation_series | ||
] | ||
|
||
assert all(expected_pose_estimation_series_are_in_nwb_file) |
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.
expected_pose_estimation_series = ["ind1_leftear", "ind1_rightear", "ind1_snout", "ind1_tailbase"] | |
expected_pose_estimation_series_are_in_nwb_file = [ | |
pose_estimation in pose_estimation_series_in_nwb for pose_estimation in expected_pose_estimation_series | |
] | |
assert all(expected_pose_estimation_series_are_in_nwb_file) | |
assert all( | |
pose_estimation in pose_estimation_series_in_nwb for pose_estimation in ["ind1_leftear", "ind1_rightear", "ind1_snout", "ind1_tailbase"] | |
) |
this would be clearer to me
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.
This is a pet peeve of mine that I think makes debuggin easier so I would like to explain myself.
The reason that I like avoid definitions inside of other scopes is that it gets on the way of the standard debuggin workflow. With the current code If the test fails, I just set a debuggin point in line 390 (pdb.set_trace()
) and then I can check immediatley what is the value of expected_pose_estimation_series_are_in_nwb_file
and think about what failed. With the proposed change I would need to evaluate the expression again to inspect it.
Moreover, before python 3.12 list comprehension is debugged as a separate frame so if I use the automated tools of my IDE I can't be in a frame that has access to both values of interest: the values inside the list comprehension and the context from which is called.
All of that said I think the first definition in line 385 can be eliminated to make this more concise but I like having all the defintions before the assertions/checks so I can debug everything in the same frame.
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.
ok, I rarely use pdb.set_trace, so I mostly go by readability, but I can see how it could get in the way for you. Feel free to ignore
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1031 +/- ##
==========================================
- Coverage 90.36% 90.32% -0.04%
==========================================
Files 129 129
Lines 7938 7988 +50
==========================================
+ Hits 7173 7215 +42
- Misses 765 773 +8
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Needed for the Cohen conversion where the files are (hopefully temporarily) missing. Plus, as described in #1030 we don't really extract any critical information from them.