Closed kachayev closed 8 months ago
@YanisLalou I have a couple of questions regarding this suite,
test_base_selector_remove_masked_transform
has a comment regarding the essence of the check, but I'm not sure the code actually does what is described in there. Could you please double check?test_base_selector_domains
only performs the assert of 'internal' state of the selector, which is something that is better to be avoided in tests. It's better to test the behavior rather than implementation details as the latter might change rather frequently while we only care about behavior staying consistent. What is the observed behavior that is verified in this test?Attention: 1 lines
in your changes are missing coverage. Please review.
Comparison is base (
8e8fc7b
) 87.16% compared to head (434a05b
) 87.29%.
Files | Patch % | Lines |
---|---|---|
skada/base.py | 75.00% | 1 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
@YanisLalou I have a couple of questions regarding this suite,
test_base_selector_remove_masked_transform
has a comment regarding the essence of the check, but I'm not sure the code actually does what is described in there. Could you please double check?test_base_selector_domains
only performs the assert of 'internal' state of the selector, which is something that is better to be avoided in tests. It's better to test the behavior rather than implementation details as the latter might change rather frequently while we only care about behavior staying consistent. What is the observed behavior that is verified in this test?
For the test_base_selector_remove_masked_transform
, we want to test if the _remove_masked
behaves as expected for a pipeline with a predictor at the end (so with a .predict() method) and for a pipeline with an adapter at the end (so with a .adapt() method). By just doing a .fit() we can know if _remove_masked
behaves as expected because otherwise a ValueError would be raised somewhere down the line in the adapt() and fit() methods respectively.
But yes by looking back at the code, we could also add an assert to check if _remove_masked() outputs arrays with coherent shapes (like for test_base_selector_remove_masked_continuous
)
Tbh for test_base_selector_domains
, the goal was to make codevoc happy. So basically testing if a selector works if we give to it a sample_domain
or not. And also to check if the default assigned domains are correct or not. But yeah if its better to not performs asserts of 'internal' state of a selector, I don't really see where we could check that the domains are correctly assigned by default.
Got it. I'll see what could be done
Looking closely into domains_
, it doesn't have any specific 'publicly visible' behavior because the functionality it was supposed to cover is just not finished. I created a separate issue for this #84.
Notable changes:
parametrize
for testing multiple scenariosnan
)==
always a better check than!=
)