Skip to content

Add keep_attrs to discrimination and Contingency#456

Open
Kkkakania wants to merge 1 commit into
xarray-contrib:mainfrom
Kkkakania:agent/keep-attrs-probabilistic
Open

Add keep_attrs to discrimination and Contingency#456
Kkkakania wants to merge 1 commit into
xarray-contrib:mainfrom
Kkkakania:agent/keep-attrs-probabilistic

Conversation

@Kkkakania

Copy link
Copy Markdown

Description

Completes the remaining keep_attrs support requested in #258.

  • adds keep_attrs=False to discrimination
  • adds keep_attrs=False to Contingency
  • preserves observation attributes for DataArray and Dataset outputs when requested
  • explicitly clears output attributes when keep_attrs=False, keeping behavior stable across xarray versions
  • activates the existing reliability attribute test and covers eager, Dask, DataArray, Dataset, and multidimensional Dataset inputs

Closes #258

Type of change

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

  • uv run --extra test pytest -q (2894 passed, 3 skipped)
  • pre-commit on all four changed files (all applicable hooks passed)

Checklist (while developing)

  • I have added documentation for the new parameters.
  • Tests added for pytest.

Pre-Merge Checklist (final steps)

  • Based on the current upstream main.
  • Contains one focused commit.

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.

keep_attrs for discrimination, rank_histogram, reliability, Contingency

1 participant