Skip to content

chore(release): 0.3.3.post1 — hotfix alphaDeesp empty red_loops guard - #124

Merged
marota merged 2 commits into
ainetus:mainfrom
marota:release/0.3.3.post1
Jul 28, 2026
Merged

marota merged 2 commits into
ainetus:mainfrom
marota:release/0.3.3.post1

Conversation

@marota

@marota marota commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

Hotfix release 0.3.3.post1

Post-release over 0.3.3 (v0.3.3 = main), no API change, backward compatible.

The bug

action_evaluation.discovery._orchestrator.discover_and_prioritize raised
TypeError: 'numpy.float64' object is not iterable on an empty red_loops
DataFrame. Structured_Overload_Distribution_Graph.get_dispatch_edges_nodes( only_loop_paths=True) computes list(set(red_loops.Path.sum())); on an empty
list-of-lists column pandas Series.sum() returns the scalar 0.0
(numpy.float64) instead of a concatenated list, so set() raises.

The pre-existing guard only covered antenna_mode; a radial pocket is just one
instance of the real condition, "no exploitable red loop".

The fix

  • _orchestrator.py: condition extended to antenna_mode or _no_red_loop
    (red_loops absent / empty / no Path column), plus a try/except TypeError
    net for a Path column carrying a residual NaN. Purely defensive on the
    consumer side — alphaDeesp itself is not patched.
  • 7 unit tests characterise the upstream defect and verify the guard
    (tests/test_discovery_boucles_rouges_vides.py).
  • Cherry-picked cleanly from a651a40 onto v0.3.3 (identical _orchestrator.py).

Impact measured downstream (Co-Study4Grid Matpower dataset grading)

  • Pre-fix: fatal traceback on 42 of 901 contingencies (4.7 %) → action
    discovery truncated → difficulty overestimated.
  • Post-fix: 0 traceback; re-grading moved those 42 out of hard
    (hard → easy 21, hard → medium 21, none the other way).
  • Tier split shifts 440/368/62 → 461/389/20 (easy/medium/hard), same 870
    scenarios, identical ids.

Validation

  • 7 guard tests pass; full suite 1883 passed on this branch.
  • The 16 test_expert_op4grid_analyzer::test_reproducibility failures are
    pre-existing on clean v0.3.3 (identical set) — an optional
    pypowsybl2grid / numpy<2 env dependency, unrelated to this change.
  • __version__ → 0.3.3.post1.

Tag v0.3.3.post1 pushed on the fork; the two commits are the isolated fix
(fix(discovery)) then the release chore (chore(release)).

🤖 Generated with Claude Code

Antoine Marot added 2 commits July 28, 2026 13:03
``get_dispatch_edges_nodes(only_loop_paths=True)`` computes
``list(set(red_loops.Path.sum()))``; on an EMPTY red_loops DataFrame pandas
``Series.sum()`` returns the scalar ``0.0`` (numpy.float64) instead of a
concatenated list, so ``set()`` raises
``TypeError: 'numpy.float64' object is not iterable``.

The pre-existing guard covered only ``antenna_mode``; the real condition is
"no exploitable red loop" (a radial pocket is one instance). Condition
extended to ``antenna_mode or _no_red_loop`` (red_loops absent / empty / no
``Path`` column), plus a ``try/except TypeError`` net for a ``Path`` column
carrying a residual NaN. Defensive on the consumer side; alphaDeesp itself is
not patched. Seven unit tests characterise the upstream defect and verify the
guard.

Cherry-picked cleanly from a651a40 onto v0.3.3 (identical _orchestrator.py).

Measured downstream (Co-Study4Grid Matpower grading): fatal on 42/901
contingencies (4.7%), truncating action discovery and overestimating
difficulty; after the fix, re-grading moved all 42 out of hard
(hard->easy 21, hard->medium 21, none the other way).

Signed-off-by: Antoine Marot <amarot91@gmail.com>
Post-release over 0.3.3: bumps version to 0.3.3.post1 (pyproject + __init__)
and records the fix in the changelog. No API change, backward compatible.
See the preceding fix(discovery) commit and a651a40.

Signed-off-by: Antoine Marot <amarot91@gmail.com>
@marota
marota force-pushed the release/0.3.3.post1 branch from 7fd5fda to d936d2b Compare July 28, 2026 11:03
@marota
marota merged commit e7c6b77 into ainetus:main Jul 28, 2026
7 checks passed
marota pushed a commit to marota/Co-Study4Grid that referenced this pull request Jul 28, 2026
Consumes the alphaDeesp empty-red_loops hotfix
(ainetus/Expert_op4grid_recommender#124, tag v0.3.3.post1). The Matpower
difficulty dataset in this branch was re-graded with that fix — 42 scenarios
reclassified out of hard (hard->easy 21, hard->medium 21), tier split
440/368/62 -> 461/389/20. CHANGELOG updated.

Signed-off-by: Antoine Marot <amarot91@gmail.com>
marota pushed a commit to marota/Co-Study4Grid that referenced this pull request Jul 28, 2026
Consumes the alphaDeesp empty-red_loops hotfix
(ainetus/Expert_op4grid_recommender#124, tag v0.3.3.post1). The Matpower
difficulty dataset in this branch was re-graded with that fix — 42 scenarios
reclassified out of hard (hard->easy 21, hard->medium 21), tier split
440/368/62 -> 461/389/20. CHANGELOG updated.

Signed-off-by: Antoine Marot <amarot91@gmail.com>
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.

1 participant