Skip to content

Unify deprecation warning channels before v1: EvolvingAPIWarning vs LinopySemanticsWarning #738

@FBumann

Description

@FBumann

Note

AI-written note (Claude Code, prompted by @FBumann) — tracking item from the #737 discussion.

There are two parallel "this will change under v1" warning channels:

Channel Introduced by Used for
EvolvingAPIWarning (subclass of FutureWarning) #732 implicit MultiIndex-level projections in broadcast_to_coords (both strict and non-strict modes since #737); piecewise API
LinopySemanticsWarning + warn_legacy() #717 (unmerged) per-site legacy-vs-v1 deprecations (NaN fills, coord mismatches, aux conflicts) with opt-in/silence hints

Before v1 ships these should be one channel — users need a single warning category to filter, and warn_legacy() already has the better infrastructure (dynamic stacklevel, opt-in hints, per-site messages).

Proposal: the migration happens as part of landing #717 (not as an independent PR) — the class must arrive together with its infrastructure (warn_legacy(), the options['semantics'] flag, the opt-in hints its docstring references). Concretely, #717's integration commit routes the MI-projection warnings in linopy/common.py (_warn_implicit_projections, marked TODO(#738)) through warn_legacy().

EvolvingAPIWarning itself stays — it serves a different purpose (API-surface evolution, e.g. piecewise) and #717 keeps both classes.

(An attempt to copy LinopySemanticsWarning into #737 ahead of #717 was considered and rejected: the class's meaning — "legacy semantics" — doesn't exist as a concept until #717's options flag lands.)

Blocked on: #732 and #717 merging. The MI projection warning site carries a TODO referencing this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions