Layered-plotting#116
Merged
Merged
Conversation
Partially completed refactor. Working fairly well, still need to write tests and clean up code base. - Removed the Plotly backend implementation due to its experimental status. - Simplified the Seaborn backend by consolidating methods and improving type hints. - Enhanced the CircumplexPlot class to support more flexible data handling and plotting. - Updated utility functions and constants for better clarity and usability. - Improved styling options and added detailed docstrings for better documentation. - Ensured compatibility with the latest changes in the plotting utilities.
- Removed unused imports from plot_functions.py. - Introduced plotting_types.py to define utility functions and constants for the plotting module. - Deleted plotting_utils.py and stylers.py as their functionalities were integrated into the new structure. - Updated relevant classes and functions to utilize the new plotting types and parameters.
Tutorials not updated yet
- Updated CircumplexPlot class to use 'x' and 'y' parameters instead of 'xcol' and 'ycol'. - Added new methods for data validation and hue checking in CircumplexPlot. - Improved density plotting methods to streamline code and enhance readability. - Introduced SPI score calculation functions and refactored existing methods for clarity. - Updated tutorial notebook to reflect changes in parameter names and usage. - Enhanced test cases for MultiSkewNorm to align with refactored SPI score method.
Deprecates CircumplexPlot in favor of new ISOPlot class with better API design Improves coordinate calculation by normalizing around scale midpoint Adds type safety and parameter validation throughout plotting module Major improvements include: - Better parameter handling and type validation - Clearer separation of plotting responsibilities - More robust legend and style handling - Normalized ISO coordinate calculations
Re-enables density_plot and jointplot functions with improved type hints and documentation Updates simple density parameters for better visualization defaults Reorganizes imports and enhances parameter handling in jointplot Makes plotting interface more consistent with modern Python practices while maintaining backwards compatibility
…on and styling options for circumplex visualizations. Adds validation for density plot data size.
…ng clarity and formatting of parameter descriptions.
…ty, and jointplot
Added proper deprecation warnings and included these in test_plotting_deprecated
Create modular architecture for ISOPlot with: - PlotContext for managing data and state - Layer abstraction system for visualization components - Enhanced parameter management with PlotParams - Support for targeted layer addition - Fluent interface preserved for method chaining
…string examples, and improve type safety across layers and context management
… improved validation and type safety, streamline seaborn and density parameters, and enhance code clarity across plotting modules.
…nagement, and enhance type safety with new ParamModel integration.
Modernizes parameter management through enhanced type models and validation - Introduces dedicated parameter models for better type safety - Simplifies layer handling with cleaner inheritance - Improves subplot management with dedicated params class - Adds better control over figure/plot lifecycle with close/save wrappers - Reorganizes plotting code for better maintainability
Restructures SPI plotting functionality to use a more flexible layered approach with better parameter management - Updates density plotting parameters with cleaner threshold handling - Improves type safety for plotting parameters - Consolidates SPI-related plotting code into dedicated layer classes - Adds better parameter validation and documentation Part of the plotting system modernization effort
Enhances the SPI Layer implementation with flexible score display options: - Enables showing SPI scores either on axis or under plot title - Adds default styling parameters for score display - Fixes data handling by filtering for relevant coordinates Updates example code to demonstrate new score display functionality
- Updated SPILayer to accept `spi_target_data` instead of `custom_data`, allowing for clearer data handling. - Added detailed docstrings for parameters in SPILayer to clarify usage and requirements. - Implemented a warning mechanism when `custom_data` is used as a fallback for `spi_target_data`. - Enhanced validation of SPI data shape to ensure it meets expected dimensions. - Removed unused generator methods from PlotContext to streamline the codebase. - Cleaned up imports in plot_functions.py by removing unnecessary collections.abc imports. - Minor adjustments in plotting_types.py to prepare for future refactoring related to `include_outline`.
…ut validation, and detailed documentation
Reorganized `ISOPlot` and plotting functions to enhance modularity and maintainability. Introduced better logging, parameter handling, and improved subplot creation with streamlined support for `subplot_by`. Added optional return of `ISOPlot` objects for greater flexibility. Adjusted some deprecated or inconsistent parameter usages for clarity. Signed-off-by: Andrew Mitchell <a.j.mitchell@ucl.ac.uk>
Cleaned up unused matplotlib and default parameter imports to improve code readability and maintainability. This helps reduce clutter and ensures only necessary dependencies are included. Signed-off-by: Andrew Mitchell <a.j.mitchell@ucl.ac.uk>
…eturn values in data preparation
Improves organization of subplot parameters by moving setup earlier in the process flow and encapsulating logic in SubplotsParams class Updates test cases in plotting functions to skip matplotlib display commands and use subset of data for better test performance
…ation - Introduced create_circumplex_subplots function to generate a grid of circumplex plots with customizable parameters. - Updated ISOPlot class to validate hue parameter against both columns and index names in the provided DataFrame. - Minor adjustments to the jointplot function to remove unused figsize height parameter.
Updated return types for plotting functions, removing references to `Self` and correcting type hints. Introduced `iso_plot` and `create_iso_subplots` for soundscape visualizations. Enhanced docstrings and addressed minor styling inconsistencies in the library configuration files. Signed-off-by: Andrew Mitchell <a.j.mitchell@ucl.ac.uk>
Breaks down complex subplot creation logic into smaller, focused functions: - Extracts data preparation into _prepare_subplot_data - Moves subplot creation logic to _create_subplots - Improves type hints and documentation clarity - Removes optional parameter from data argument for better type safety Makes the code more maintainable and easier to understand while maintaining existing functionality.
Replaces `apply_styling` with `style` for more concise API and improves error handling across plotting functions. Adds new experimental warning and centralizes several error messages for better consistency and maintainability. Several deprecated or redundant methods were removed or replaced with streamlined logic. Signed-off-by: Andrew Mitchell <a.j.mitchell@ucl.ac.uk>
Signed-off-by: Andrew Mitchell <a.j.mitchell@ucl.ac.uk>
Replaced `ParamModel.create` with direct subclass instantiation for cleaner and more explicit parameter initialization. Improved flexibility in parameter updates by introducing `ignore_null` and utilizing Pydantic's native validation mechanisms. Updated plot functions with better defaults, added support for dynamic subtitle handling, and marked `create_circumplex_subplots` as deprecated in favor of `create_iso_subplots`. Signed-off-by: Andrew Mitchell <a.j.mitchell@ucl.ac.uk>
Refactored parameter models to use dataclasses for better type validation and maintainability. Updated the `add_layer` methods to drop "data" key where needed. Added extensive test coverage for the new dataclass-based parameter logic, ensuring robust behavior across various scenarios. Signed-off-by: Andrew Mitchell <a.j.mitchell@ucl.ac.uk>
Signed-off-by: Andrew Mitchell <a.j.mitchell@ucl.ac.uk>
Replaced `model_copy` with `copy` for parameter models to enhance clarity and consistency in various modules. Updated plotting logic, refined default values (e.g., `title_fontsize`), fixed bugs in SPI layer behavior, and streamlined testing by reorganizing tests and updating the test model naming conventions. Signed-off-by: Andrew Mitchell <a.j.mitchell@ucl.ac.uk>
Removed outdated backends documentation and replaced it with new plotting-related sections like `plot_functions` and `iso_plot`. Updated testing to ignore specific files (`iso_plot.py`) and enhanced config formatting consistency in `pyproject.toml` and `tox.ini`. Disabled certain pre-commit hooks temporarily for further refinement. Signed-off-by: Andrew Mitchell <a.j.mitchell@ucl.ac.uk>
Owner
Author
|
This pull request introduces significant updates to the Deprecation and Replacement of Plotting APIs:
Documentation Updates:
Configuration and Dependency Enhancements:
Codebase Enhancements:
Minor Improvements:
These changes collectively modernize the |
This was referenced May 12, 2025
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.
No description provided.