FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Ajouter `graph_sankey` pour tracer des flux Sankey et couvrir les validations d’entrée by Copilot · Pull Request #95 · sdpython/teachpyx · GitHub

Repository navigation

Ajouter graph_sankey pour tracer des flux Sankey et couvrir les validations d’entrée - #95

Draft
xadupre with Copilot wants to merge 8 commits into
mainfrom
copilot/implement-sankey-graph-function
Draft

xadupre with Copilot wants to merge 8 commits into
mainfrom
copilot/implement-sankey-graph-function

Conversation

Copilot AI commented Apr 13, 2026 •
edited
Loading

Copy link
Copy Markdown
Contributor

L’issue demandait l’ajout d’une fonction pour produire un graphique de Sankey (flux). Cette PR introduit une API dédiée dans le module FAQ Python avec des contrôles d’intégrité des flux et des tests ciblés.

  • Nouvelle API Sankey

    • Ajout de graph_sankey dans teachpyx.faq.faq_python.
    • Génère un diagramme via matplotlib.sankey.Sankey.
    • Supporte flows, labels, orientations, ax, title, et passthrough **kwargs vers Sankey.add.
  • Validations d’entrée

    • Vérifie qu’il y a au moins deux flux.
    • Vérifie l’équilibre global des flux (somme proche de zéro avec tolérance dédiée).
    • Vérifie la cohérence des longueurs flows / labels / orientations.
    • Messages d’erreur enrichis avec les valeurs observées pour faciliter le diagnostic.
  • Couverture unitaire

    • Extension de _unittests/ut_faq/test_faq_python.py :
      • cas nominal (création du diagramme + titre),
      • cas invalides (taille insuffisante, flux non équilibrés, longueurs incohérentes).
from teachpyx.faq.faq_python import graph_sankey

ax, diagrams = graph_sankey(
    [1, -0.25, -0.75],
    labels=["input", "loss", "output"],
    orientations=[0, 1, -1],
    title="flux",
)

Copilot AI changed the title [WIP] Add function to create a Sankey graph Ajouter graph_sankey pour tracer des flux Sankey et couvrir les validations d’entrée Apr 13, 2026
Copilot AI requested a review from xadupre April 13, 2026 14:09
diagrams = sankey.finish()
if title is not None:
ax.set_title(title)
return ax, diagrams

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

@copilot ajoute un exemple à la documentation

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

C’est fait dans le commit 146049e : j’ai ajouté un exemple d’utilisation concret dans la docstring de graph_sankey.

Copilot AI requested a review from xadupre April 13, 2026 14:41
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

implementer une fonction qui fait un graphique de sankey (flux)

2 participants


Back | FazBrowse Home | New Git URL