Skip to content

Conversation

Copy link

Copilot AI commented Oct 11, 2025

This PR fixes doctest failures in the repository by correcting the coordinate ordering in expected outputs to match the actual xarray behavior.

Issue Identified

Two doctest failures were found:

  1. xskillscore.core.probabilistic.discrimination - coordinate ordering mismatch
  2. xskillscore.core.stattests.multipletests - coordinate ordering mismatch

The issue was caused by xarray's coordinate ordering in outputs, which differs from what was documented in the expected test outputs.

Changes Made

  • discrimination function: Reordered coordinates in expected output from forecast_probability, event to event, forecast_probability
  • multipletests function: Reordered coordinates in expected output from x, y, result to result, x, y

Verification

  • ✅ All 32 doctests now pass successfully
  • ✅ No functional code changes - only documentation/test output corrections
  • ✅ Changes are minimal and surgical, affecting only the expected output formatting in docstrings

This fix addresses issue #435.

Original prompt

The task is to fix the doctests in the repository by reordering the test cases so that they run correctly. This includes identifying the current issue with the doctests, rearranging the test cases to ensure they execute in the proper order without errors, and verifying the fix by running the doctests. The fix should be implemented in the branch associated with issue #435.

This pull request was created as a result of the following prompt from Copilot chat.

The task is to fix the doctests in the repository by reordering the test cases so that they run correctly. This includes identifying the current issue with the doctests, rearranging the test cases to ensure they execute in the proper order without errors, and verifying the fix by running the doctests. The fix should be implemented in the branch associated with issue #435.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

@aaronspring aaronspring changed the base branch from main to aaronspring-patch-1 October 11, 2025 10:11
Copilot AI requested a review from aaronspring October 11, 2025 10:17
Copilot finished work on behalf of aaronspring October 11, 2025 10:17
@aaronspring aaronspring reopened this Oct 11, 2025
@aaronspring
Copy link
Collaborator

@copilot continue

@codecov
Copy link

codecov bot commented Oct 11, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (aaronspring-patch-1@217a0c2). Learn more about missing BASE report.

Additional details and impacted files
@@                  Coverage Diff                   @@
##             aaronspring-patch-1     #436   +/-   ##
======================================================
  Coverage                       ?   94.55%           
======================================================
  Files                          ?       27           
  Lines                          ?     2830           
  Branches                       ?        0           
======================================================
  Hits                           ?     2676           
  Misses                         ?      154           
  Partials                       ?        0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Author

Copilot AI commented Oct 11, 2025

@copilot continue

Fixed the doctest failures. The issue was that coordinate ordering in xarray outputs had changed. I reordered the coordinates in the expected outputs for two functions:

  1. discrimination - swapped order of event and forecast_probability coordinates
  2. multipletests - moved result coordinate before x and y coordinates

All 32 doctests now pass. Commit: d9ec2d4

Copilot AI changed the title [WIP] Fix doctests by reordering test cases for correctness Fix doctests by reordering coordinates in expected outputs Oct 11, 2025
Copilot finished work on behalf of aaronspring October 11, 2025 10:28
@aaronspring
Copy link
Collaborator

Nice. But did manually quicker.

@aaronspring aaronspring deleted the copilot/fix-doctests-ordering-issue-435 branch October 11, 2025 10:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants