Repository navigation
fix: plot()/highlight_edge() crashes found by mypy; mypy to zero - #29
Merged
Merged
Conversation
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… zero
mypy's 7 baseline errors were real runtime bugs, not noise:
- plot(text=None) and plot(text=True) raised TypeError ('** must be a
mapping') although the docstring says None means default formatting
- plot() on a graph without coordinates raised 'NoneType has no len()',
and on an empty graph IndexError; both are now a clear ValueError
- in 3D with colorcomponents=False the vertex marker was drawn at z=0
- highlight_edge() on a removed edge raised AttributeError; now ValueError
- vopt/eopt/text had mutable {} defaults; now None
- block is documented and used as bool|None (None = don't show)
Also drops python_version=3.9 from [tool.mypy], which current mypy rejects.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #29 +/- ##
==========================================
+ Coverage 87.60% 89.37% +1.76%
==========================================
Files 2 2
Lines 815 828 +13
==========================================
+ Hits 714 740 +26
+ Misses 101 88 -13 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 31 |
| Duplication | -2 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The 7 baseline mypy errors turned out to be real runtime bugs in
plot()andhighlight_edge(), not noise. This fixes them and takes mypy to zero.plot(text=None),plot(text=True)TypeError: ** must be a mapping, although the docstring saysNoneis default formattingplot()with vertices that have no coordinate'NoneType' has no len()ValueErrorplot()on an empty graphIndexErrorValueErrorcolorcomponents=Falsehighlight_edge()on a removed edgeAttributeErrorValueErrorvopt,eopt,textdefaults{}NoneblockboolthoughNoneis documented and usedbool | None; docs said "defaults to True", code isFalse, docs correctedConfig / CI
python_version = "3.9"from[tool.mypy]; current mypy rejects it as unsupported.requires-pythonis unchanged.continue-on-error). Happy to drop that commit if you want to keep it informational. Noteall-tests-passeddepends only onunittest, so this shows as a red check rather than blocking the gate.Tests
tests/test_plot_args.py(14 tests, Agg backend); nine of them fail onmain.🤖 Generated with Claude Code