Skip to content

fix: compatibility with xarray 2026.4.0#649

Closed
FBumann wants to merge 4 commits intomasterfrom
fix/xarray-2026.4-compat
Closed

fix: compatibility with xarray 2026.4.0#649
FBumann wants to merge 4 commits intomasterfrom
fix/xarray-2026.4-compat

Conversation

@FBumann
Copy link
Copy Markdown
Collaborator

@FBumann FBumann commented Apr 16, 2026

Summary

Closes #650

  • xarray 2026.4.0 no longer allows passing a Dataset to the Dataset() constructor (xarray GH11095)
  • Remove redundant Dataset() wrappers around transpose() and assign_coords() calls that already return a Dataset
  • Add isinstance check in Model.parameters setter where input may be either a Dataset or a Mapping

Note: Pre-existing CI failures unrelated to this change:

Test plan

  • Full test suite passes with xarray 2026.4.0 (2689 passed, 236 skipped)
  • CI confirms compatibility across supported Python/xarray versions

🤖 Generated with Claude Code

FBumann and others added 4 commits April 16, 2026 17:14
xarray 2026.4.0 no longer allows passing a Dataset to the Dataset()
constructor. Remove redundant Dataset() wrappers around methods that
already return a Dataset (transpose, assign_coords), and add an
isinstance check in the parameters setter where the input may be
either a Dataset or a Mapping.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
highspy 1.14.0 returns suboptimal solutions for modified MIP models,
causing test_modified_model to fail across all platforms.

Closes #651

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The `cls` parameter was typed as `type[GenericExpression]` but assigned
concrete subclasses. Use `type[GenericExpression] | None` with a
targeted type: ignore on the narrowing assignment, and add an assert
to satisfy mypy at the call site.

Closes #652

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@FBumann
Copy link
Copy Markdown
Collaborator Author

FBumann commented Apr 16, 2026

Duplicate of #647 by @maurerle which covers the same xarray fixes plus the HiGHS workaround.

@FBumann FBumann closed this Apr 16, 2026
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.

bug: Incompatible with xarray 2026.4.0 — Dataset(Dataset) no longer allowed

1 participant