Commit 19d80f5
Fix discrimination function to preserve Dataset type
The discrimination function was incorrectly always returning a DataArray,
even when the input was a Dataset. This caused test failures where:
- Dataset inputs returned DataArray outputs (type mismatch)
- Using .values on Dataset returned bound methods instead of data
Changes:
- Add type checking to preserve input type (Dataset vs DataArray)
- Use .data instead of .values to preserve dask arrays
- Return Dataset as-is without reconstruction when input is Dataset
Fixes test_discrimination_sum failures across all Python versions.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>1 parent 750cd28 commit 19d80f5
1 file changed
+14
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1037 | 1037 | | |
1038 | 1038 | | |
1039 | 1039 | | |
1040 | | - | |
1041 | | - | |
1042 | | - | |
1043 | | - | |
1044 | | - | |
1045 | | - | |
1046 | | - | |
1047 | | - | |
1048 | | - | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
1049 | 1054 | | |
1050 | 1055 | | |
1051 | 1056 | | |
| |||
0 commit comments