refactor: reorganize package into subpackages (figure/, axes/, plot1d/, plot2d/, plot3d/, widgets/)#12
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #12 +/- ##
==========================================
+ Coverage 77.61% 78.31% +0.69%
==========================================
Files 12 29 +17
Lines 2319 2389 +70
==========================================
+ Hits 1800 1871 +71
+ Misses 519 518 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Moves _LINESTYLE_ALIASES, _arr_to_b64, _norm_linestyle, _normalize_image, _CMAP_ALIASES, _build_colormap_lut, and _resample_mesh out of figure_plots.py into a new anyplotlib/_utils.py. Backward-compat re-imports are added to figure_plots.py so all existing callers continue to work unchanged.
Moves Plot3D and _triangulate_grid out of figure_plots.py into the new anyplotlib/plot3d/ subpackage. A backward-compat shim in figure_plots.py re-exports Plot3D so existing imports continue to work.
Addresses code quality review flag: adds one-line docstrings to anyplotlib/widgets, anyplotlib/plot3d, and anyplotlib/plot2d __init__.py files. Also updates figure_plots.py docstring to reflect its new role as a compatibility shim re-exporting classes from dedicated subpackages.
Line1D and Plot1D kept in the same file (_plot1d.py) to avoid circular imports; figure_plots.py retains backward-compatible re-exports.
Moves Axes and InsetAxes out of figure_plots.py into anyplotlib/axes/_axes.py and anyplotlib/axes/_inset_axes.py respectively. Also relocates _plot_kind() to _inset_axes.py where it is used. Backward-compat shims in figure_plots.py preserve all existing import paths.
Remove unused GridSpec from _figure.py, Union from _gridspec.py, and Axes from _subplots.py; also fix stale docstring cross-reference in _subplots.py (figure_plots.Axes → axes.Axes).
…e figure_plots.py shim Update top-level __init__.py to import directly from axes, plot1d, plot2d, and plot3d subpackages instead of the figure_plots compat shim. Delete figure_plots.py and fix all test files that still imported from it.
…mples Replace all :meth:`~anyplotlib.figure_plots.Plot1D.*` and :meth:`~anyplotlib.figure_plots.Plot2D.*` Sphinx cross-reference strings in the Examples directory with the correct new module paths (anyplotlib.plot1d.Plot1D and anyplotlib.plot2d.Plot2D) following the project reorganization that deleted figure_plots.py.
478c791 to
145be85
Compare
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
figure_plots.py(3645 lines) andwidgets.py(530 lines) into focused subpackages, following matplotlib's organizational conventionsfigure/,axes/,plot1d/,plot2d/,plot3d/,widgets/,_utils.pyimport anyplotlibandfrom anyplotlib import ...calls continue to workNew Package Structure
Test Plan
pytest anyplotlib/tests/ -q)anyplotlib.__all__)figure_plots,widgets.py)test_benchmarks_py.py)